use c++11 fixed width integer types in jeeps. (#1217)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Wed, 15 Nov 2023 14:27:00 +0000 (07:27 -0700)
committerGitHub <noreply@github.com>
Wed, 15 Nov 2023 14:27:00 +0000 (07:27 -0700)
* use c++11 fixed width integer types in jeeps.

thanks resharper!

* fix fixed width integers resharper missed.

in non windows code.

31 files changed:
CMakeSettings.json [new file with mode: 0644]
garmin.cc
jeeps/gps.h
jeeps/gpsapp.cc
jeeps/gpsapp.h
jeeps/gpscom.cc
jeeps/gpscom.h
jeeps/gpsdevice.cc
jeeps/gpsdevice.h
jeeps/gpsdevice_usb.cc
jeeps/gpsfmt.h
jeeps/gpsmath.cc
jeeps/gpsmath.h
jeeps/gpsmem.cc
jeeps/gpsport.h
jeeps/gpsprot.cc
jeeps/gpsprot.h
jeeps/gpsread.cc
jeeps/gpsread.h
jeeps/gpsrqst.cc
jeeps/gpsrqst.h
jeeps/gpssend.cc
jeeps/gpssend.h
jeeps/gpsserial.cc
jeeps/gpsserial.h
jeeps/gpsusbint.h
jeeps/gpsusbread.cc
jeeps/gpsusbsend.cc
jeeps/gpsutil.cc
jeeps/gpsutil.h
xcsv.cc

diff --git a/CMakeSettings.json b/CMakeSettings.json
new file mode 100644 (file)
index 0000000..8e1f10f
--- /dev/null
@@ -0,0 +1,26 @@
+{\r
+       "configurations": [\r
+               {\r
+                       "name": "x64-Debug",\r
+                       "generator": "Ninja",\r
+                       "configurationType": "Debug",\r
+                       "inheritEnvironments": [ "msvc_x64_x64" ],\r
+                       "buildRoot": "${projectDir}\\out\\build\\${name}",\r
+                       "installRoot": "${projectDir}\\out\\install\\${name}",\r
+                       "cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/6.5.3/msvc2019_64",\r
+                       "buildCommandArgs": "",\r
+                       "ctestCommandArgs": ""\r
+               },\r
+               {\r
+                       "name": "x64-Clang-Debug",\r
+                       "generator": "Ninja",\r
+                       "configurationType": "Debug",\r
+                       "buildRoot": "${projectDir}\\out\\build\\${name}",\r
+                       "installRoot": "${projectDir}\\out\\install\\${name}",\r
+                       "cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/6.5.3/msvc2019_64 -DCMAKE_VERBOSE_MAKEFILE=ON",\r
+                       "buildCommandArgs": "",\r
+                       "ctestCommandArgs": "",\r
+                       "inheritEnvironments": [ "clang_cl_x64_x64" ]\r
+               }\r
+       ]\r
+}
\ No newline at end of file
index c8ab8f234dc80648dbc96ec45f059938848b7a2a..cfe7674a0f33b6764bc8ff10dadba1b3899bba05 100644 (file)
--- a/garmin.cc
+++ b/garmin.cc
@@ -535,7 +535,7 @@ track_read()
   }
 
 
-  int32 ntracks = GPS_Command_Get_Track(portname, &array, waypt_read_cb);
+  int32_t ntracks = GPS_Command_Get_Track(portname, &array, waypt_read_cb);
 
   if (ntracks <= 0) {
     return;
@@ -613,7 +613,7 @@ route_read()
    */
   route_head* rte_head = nullptr;
 
-  int32 nroutepts = GPS_Command_Get_Route(portname, &array);
+  int32_t nroutepts = GPS_Command_Get_Route(portname, &array);
 
 //     fprintf(stderr, "Routes %d\n", (int) nroutepts);
 #if 1
@@ -974,7 +974,7 @@ waypoint_write()
 {
   int n = waypoint_prepare();
 
-  if (int32 ret = GPS_Command_Send_Waypoint(portname, tx_waylist, n, waypt_write_cb); ret < 0) {
+  if (int32_t ret = GPS_Command_Send_Waypoint(portname, tx_waylist, n, waypt_write_cb); ret < 0) {
     fatal(MYNAME ":communication error sending waypoints..\n");
   }
 
@@ -1103,7 +1103,7 @@ track_waypt_pr(const Waypoint* wpt)
 static int
 track_prepare()
 {
-  int32 n = track_waypt_count() + track_count();
+       int32_t n = track_waypt_count() + track_count();
 
   tx_tracklist = (GPS_STrack**) xcalloc(n, sizeof(GPS_PTrack));
   cur_tx_tracklist_entry = tx_tracklist;
index a3701a998ed026372f3c0eaeae9f392db270926e..7dd742c2a1975dd2d8c74f77e2b1aa8a91e50a5e 100644 (file)
 #define ETX 0x03
 
 
-extern int32 gps_errno;
-extern int32 gps_warning;
-extern int32 gps_error;
-extern int32 gps_user;
-extern int32 gps_show_bytes;
+extern int32_t gps_errno;
+extern int32_t gps_warning;
+extern int32_t gps_error;
+extern int32_t gps_user;
+extern int32_t gps_show_bytes;
 extern char gps_categories[16][17];
 
 
 struct GPS_Packet {
   US type{0};
-  uint32 n{0};
+  uint32_t n{0};
   UC data[MAX_GPS_PACKET_SIZE]{};
 };
 
@@ -51,7 +51,7 @@ typedef struct GPS_SPvt_Data_Type {
   float epe;
   float eph;
   float epv;
-  int16 fix;
+  int16_t fix;
   double tow;
   double lat;
   double lon;
@@ -59,8 +59,8 @@ typedef struct GPS_SPvt_Data_Type {
   float north;
   float up;
   float msl_hght;
-  int16 leap_scnds;
-  int32 wn_days;
+  int16_t leap_scnds;
+  int32_t wn_days;
 } GPS_OPvt_Data, *GPS_PPvt_Data;
 
 
@@ -79,8 +79,8 @@ typedef struct GPS_STrack {
   unsigned int   tnew:1;       /* New track? */
   unsigned int   ishdr:1;      /* Track header? */
   unsigned int   no_latlon:1;  /* True if no valid lat/lon found. */
-  int32    dspl;               /* Display on map? */
-  int32    colour;             /* Colour */
+  int32_t dspl;                /* Display on map? */
+  int32_t colour;              /* Colour */
   float    distance; /* distance traveled in meters.*/
   int      distance_populated; /* True if above is valid. */
   char     trk_ident[256];     /* Track identifier */
@@ -91,7 +91,7 @@ GPS_OTrack, *GPS_PTrack;
 
 typedef struct GPS_SAlmanac {
   UC    svid;
-  int16 wn;
+  int16_t wn;
   float toa;
   float af0;
   float af1;
@@ -112,12 +112,12 @@ typedef struct GPS_SWay {
   double lon;
   char   cmnt[256];
   float  dst;
-  int32  smbl;
-  int32  dspl;
+  int32_t smbl;
+  int32_t dspl;
   char   wpt_ident[256];
   char   lnk_ident[256];
   UC     subclass[18];
-  int32  colour;
+  int32_t colour;
   char   cc[2];
   UC     wpt_class;
   UC     alt_is_unknown;
@@ -128,17 +128,17 @@ typedef struct GPS_SWay {
   char   facility[32];
   char   addr[52];
   char   cross_road[52];
-  int32  attr;
+  int32_t attr;
   float  dpth;
-  int32  idx;
-  int32  prot;
-  int32  isrte;
-  int32  rte_prot;
+  int32_t idx;
+  int32_t prot;
+  int32_t isrte;
+  int32_t rte_prot;
   UC     rte_num;
   char   rte_cmnt[20];
   char   rte_ident[256];
-  int32  islink;
-  int32  rte_link_class;
+  int32_t islink;
+  int32_t rte_link_class;
   char   rte_link_subclass[18];
   char   rte_link_ident[256];
 
@@ -146,7 +146,7 @@ typedef struct GPS_SWay {
   time_t   time;               /* Unix time */
   char     temperature_populated;
   float    temperature;                /* Degrees celsius. */
-  uint16   category;
+  uint16_t category;
 
 } GPS_OWay, *GPS_PWay;
 
@@ -154,16 +154,16 @@ typedef struct GPS_SWay {
  * Forerunner/Edge Lap data.
  */
 typedef struct GPS_SLap {
-  uint32 index; /* unique index in device or -1 */
+       uint32_t index; /* unique index in device or -1 */
   time_t       start_time;
-  uint32       total_time;     /* Hundredths of a second */
+       uint32_t total_time;    /* Hundredths of a second */
   float        total_distance; /* In meters */
   double       begin_lat;
   double       begin_lon;
   double       end_lat;
   double       end_lon;
-  int16        calories;
-  uint32 track_index; /* ref to track or -1 */
+       int16_t calories;
+       uint32_t track_index; /* ref to track or -1 */
   float max_speed; /* In meters per second */
   unsigned char avg_heart_rate; /* In beats-per-minute, 0 if invalid */
   unsigned char max_heart_rate; /* In beats-per-minute, 0 if invalid */
@@ -179,17 +179,17 @@ typedef struct GPS_SLap {
 
 
 typedef struct GPS_SCourse {
-  uint32    index;                    /* Unique among courses on device */
+       uint32_t index;                    /* Unique among courses on device */
   char      course_name[16];          /* Null-terminated unique course name */
-  uint32    track_index;              /* Index of the associated track
+       uint32_t track_index;              /* Index of the associated track
                                          * Must be 0xFFFFFFFF if there is none*/
 } GPS_OCourse, *GPS_PCourse;
 
 
 typedef struct GPS_SCourse_Lap {
-  uint32        course_index;         /* Index of associated course */
-  uint32        lap_index;            /* This lap's index in the course */
-  uint32        total_time;           /* In hundredths of a second */
+       uint32_t course_index;         /* Index of associated course */
+       uint32_t lap_index;            /* This lap's index in the course */
+       uint32_t total_time;           /* In hundredths of a second */
   float         total_dist;           /* [m] */
   double        begin_lat;            /* Starting position of the lap */
   double        begin_lon;            /* Invalid if lat,lon are 0x7FFFFFFF.*/
@@ -204,7 +204,7 @@ typedef struct GPS_SCourse_Lap {
 
 typedef struct GPS_SCourse_Point {
   char        name[11];               /* Null-terminated name */
-  uint32      course_index;           /* Index of associated course */
+  uint32_t course_index;           /* Index of associated course */
   time_t      track_point_time;       /* Time */
   UC          point_type;             /* generic = 0,
                                          * summit = 1,
@@ -225,10 +225,10 @@ typedef struct GPS_SCourse_Point {
 } GPS_OCourse_Point, *GPS_PCourse_Point;
 
 typedef struct GPS_SCourse_Limits {
-  int32 max_courses;
-  int32 max_course_laps;
-  int32 max_course_pnt;
-  int32 max_course_trk_pnt;
+       int32_t max_courses;
+       int32_t max_course_laps;
+       int32_t max_course_pnt;
+  int32_t max_course_trk_pnt;
 } GPS_OCourse_Limits, *GPS_PCourse_Limits;
 
 
@@ -249,7 +249,7 @@ using pcb_fn = int (*)(int, GPS_SWay**);
 extern time_t gps_save_time;
 extern double gps_save_lat;
 extern double gps_save_lon;
-extern int32  gps_save_id;
+extern int32_t gps_save_id;
 extern double gps_save_version;
 extern char   gps_save_string[GPS_ARB_LEN];
 extern int gps_is_usb;
index c66ad672c88d06fcd7a69c4780b3db69b3a13304..43312fe37f3f7e8d536f621d0dde634000077f94 100644 (file)
@@ -46,7 +46,7 @@ double gps_save_lon;
 
 #define XMIN(a,b) (a < b? a : b)
 
-static int32    GPS_A000(const char* port);
+static int32_t GPS_A000(const char* port);
 static void   GPS_A001(const GPS_Packet& packet);
 
 
@@ -72,21 +72,21 @@ static void   GPS_D152_Get(GPS_PWay* way, UC* s);
 static void   GPS_D154_Get(GPS_PWay* way, UC* s);
 static void   GPS_D155_Get(GPS_PWay* way, UC* s);
 
-static void   GPS_D100_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D101_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D102_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D103_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D104_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D105_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D106_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D107_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D108_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D109_Send(UC* data, GPS_PWay way, int32* len, int protoid);
-static void   GPS_D150_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D151_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D152_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D154_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D155_Send(UC* data, GPS_PWay way, int32* len);
+static void   GPS_D100_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D101_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D102_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D103_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D104_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D105_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D106_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D107_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D108_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D109_Send(UC* data, GPS_PWay way, int32_t* len, int protoid);
+static void   GPS_D150_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D151_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D152_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D154_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D155_Send(UC* data, GPS_PWay way, int32_t* len);
 
 static void   GPS_D120_Get(int cat_num, char*s);
 
@@ -94,17 +94,17 @@ static void   GPS_D200_Get(GPS_PWay* way, const UC* s);
 static void   GPS_D201_Get(GPS_PWay* way, UC* s);
 static void   GPS_D202_Get(GPS_PWay* way, UC* s);
 static void   GPS_D210_Get(GPS_PWay* way, UC* s);
-static void   GPS_D200_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D201_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D202_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D210_Send(UC* data, GPS_PWay way, int32* len);
+static void   GPS_D200_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D201_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D202_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D210_Send(UC* data, GPS_PWay way, int32_t* len);
 
 static void   GPS_D400_Get(GPS_PWay* way, UC* s);
 static void   GPS_D403_Get(GPS_PWay* way, UC* s);
 static void   GPS_D450_Get(GPS_PWay* way, UC* s);
-static void   GPS_D400_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D403_Send(UC* data, GPS_PWay way, int32* len);
-static void   GPS_D450_Send(UC* data, GPS_PWay way, int32* len);
+static void   GPS_D400_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D403_Send(UC* data, GPS_PWay way, int32_t* len);
+static void   GPS_D450_Send(UC* data, GPS_PWay way, int32_t* len);
 
 static void   GPS_D500_Send(UC* data, GPS_PAlmanac alm);
 static void   GPS_D501_Send(UC* data, GPS_PAlmanac alm);
@@ -114,7 +114,7 @@ static void   GPS_D551_Send(UC* data, GPS_PAlmanac alm);
 static UC Is_Trackpoint_Invalid(GPS_PTrack trk);
 
 
-int32  gps_save_id;
+int32_t gps_save_id;
 int    gps_is_usb;
 double gps_save_version;
 char   gps_save_string[GPS_ARB_LEN];
@@ -161,9 +161,9 @@ void copy_char_array(UC** dst, char* src, int count, copycase mustupper)
 **
 ** @return [int32] 1 if success -ve if error
 ************************************************************************/
-int32 GPS_Init(const char* port)
+int32_t GPS_Init(const char* port)
 {
-  int32 ret;
+       int32_t ret;
 
   (void) GPS_Util_Little();
 
@@ -198,13 +198,13 @@ int32 GPS_Init(const char* port)
 **
 ** @return [int32] 1 if success -ve if error
 ************************************************************************/
-static int32 GPS_A000(const char* port)
+static int32_t GPS_A000(const char* port)
 {
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int16 version;
-  int16 id;
+  int16_t version;
+  int16_t id;
 
   if (!GPS_Device_On(port, &fd)) {
     return gps_errno;
@@ -387,10 +387,10 @@ static void GPS_A001(const GPS_Packet& packet)
 {
   US lasta=0;
 
-  int32 entries = packet.n / 3;
+  int32_t entries = packet.n / 3;
   const UC* p = packet.data;
 
-  for (int32 i=0; i<entries; ++i,p+=3) {
+  for (int32_t i = 0; i<entries; ++i,p+=3) {
     US tag = *p;
     US data = GPS_Util_Get_Short(p+1);
 
@@ -857,14 +857,14 @@ static void GPS_A001(const GPS_Packet& packet)
 **
 ** @return [int32] number of waypoint entries
 ************************************************************************/
-int32 GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int, GPS_PWay*))
+int32_t GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int, GPS_PWay*))
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 n;
-  int32 i;
+  int32_t n;
+  int32_t i;
 
 
   if (!GPS_Device_On(port,&fd)) {
@@ -1009,14 +1009,14 @@ int32 GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int, GPS_PWay*))
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A100_Send(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_PWay*))
+int32_t GPS_A100_Send(const char* port, GPS_PWay* way, int32_t n, int (*cb)(GPS_PWay*))
 {
   UC data[GPS_ARB_LEN];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
+  int32_t i;
+  int32_t len;
 
   if (!GPS_Device_On(port,&fd)) {
     return gps_errno;
@@ -1130,14 +1130,14 @@ int32 GPS_A100_Send(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_PWay
 /*
  * Get the list of waypoint categories from the receiver.
  */
-int32 GPS_A101_Get(const char* port)
+int32_t GPS_A101_Get(const char* port)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 n;
-  int32 i;
+  int32_t n;
+  int32_t i;
 
 
   if (!GPS_Device_On(port,&fd)) {
@@ -1211,7 +1211,7 @@ int32 GPS_A101_Get(const char* port)
 static void GPS_D100_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1221,12 +1221,12 @@ static void GPS_D100_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1249,7 +1249,7 @@ static void GPS_D100_Get(GPS_PWay* way, UC* s)
 static void GPS_D101_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1259,12 +1259,12 @@ static void GPS_D101_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1292,7 +1292,7 @@ static void GPS_D101_Get(GPS_PWay* way, UC* s)
 static void GPS_D102_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1302,12 +1302,12 @@ static void GPS_D102_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1336,7 +1336,7 @@ static void GPS_D102_Get(GPS_PWay* way, UC* s)
 static void GPS_D103_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1346,12 +1346,12 @@ static void GPS_D103_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1378,7 +1378,7 @@ static void GPS_D103_Get(GPS_PWay* way, UC* s)
 static void GPS_D104_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1388,12 +1388,12 @@ static void GPS_D104_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1403,7 +1403,7 @@ static void GPS_D104_Get(GPS_PWay* way, UC* s)
   p+=sizeof(float);
 
   (*way)->smbl = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   (*way)->dspl = *p;
 
@@ -1431,13 +1431,13 @@ static void GPS_D105_Get(GPS_PWay* way, UC* s)
   (*way)->prot = 105;
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->smbl = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   q = (UC*)(*way)->wpt_ident;
   while ((*q++ = *p++));
@@ -1460,7 +1460,7 @@ void GPS_D106_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
   UC* q;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1473,13 +1473,13 @@ void GPS_D106_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->smbl = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   q = (UC*)(*way)->wpt_ident;
   while ((*q++ = *p++));
@@ -1503,7 +1503,7 @@ void GPS_D106_Get(GPS_PWay* way, UC* s)
 static void GPS_D107_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1513,12 +1513,12 @@ static void GPS_D107_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1551,7 +1551,7 @@ static void GPS_D108_Get(GPS_PWay* way, UC* s)
   UC* p;
   UC* q;
 
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1562,16 +1562,16 @@ static void GPS_D108_Get(GPS_PWay* way, UC* s)
   (*way)->dspl      = *p++;
   (*way)->attr      = *p++;
   (*way)->smbl = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
   for (i=0; i<18; ++i) {
     (*way)->subclass[i] = *p++;
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->alt = GPS_Util_Get_Float(p);
   p+=sizeof(float);
@@ -1625,7 +1625,7 @@ static void GPS_D109_Get(GPS_PWay* way, UC* s, int protoid)
   UC* p;
   UC* q;
 
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1637,16 +1637,16 @@ static void GPS_D109_Get(GPS_PWay* way, UC* s, int protoid)
   (*way)->dspl      = (*p++ >> 5) & 3;
   (*way)->attr      = *p++;
   (*way)->smbl = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
   for (i=0; i<18; ++i) {
     (*way)->subclass[i] = *p++;
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->alt = GPS_Util_Get_Float(p);
   p+=sizeof(float);
@@ -1672,7 +1672,7 @@ static void GPS_D109_Get(GPS_PWay* way, UC* s, int protoid)
       (*way)->temperature = gps_temp;
     }
 
-    uint32 gps_time = GPS_Util_Get_Uint(p);
+    uint32_t gps_time = GPS_Util_Get_Uint(p);
     p+=4;
     /* The spec says that 0xffffffff is unknown, but the 60CSX with
      * firmware 2.5.0 writes zero.
@@ -1719,7 +1719,7 @@ static void GPS_D109_Get(GPS_PWay* way, UC* s, int protoid)
 static void GPS_D150_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1733,13 +1733,13 @@ static void GPS_D150_Get(GPS_PWay* way, UC* s)
   (*way)->wpt_class = *p++;
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->alt = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<24; ++i) {
     (*way)->city[i] = *p++;
@@ -1771,7 +1771,7 @@ static void GPS_D150_Get(GPS_PWay* way, UC* s)
 static void GPS_D151_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1781,12 +1781,12 @@ static void GPS_D151_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1806,7 +1806,7 @@ static void GPS_D151_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->alt = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<2; ++i) {
     (*way)->cc[i] = *p++;
@@ -1833,7 +1833,7 @@ static void GPS_D151_Get(GPS_PWay* way, UC* s)
 static void GPS_D152_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1843,12 +1843,12 @@ static void GPS_D152_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1868,7 +1868,7 @@ static void GPS_D152_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->alt = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<2; ++i) {
     (*way)->cc[i] = *p++;
@@ -1894,7 +1894,7 @@ static void GPS_D152_Get(GPS_PWay* way, UC* s)
 static void GPS_D154_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1904,12 +1904,12 @@ static void GPS_D154_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1929,7 +1929,7 @@ static void GPS_D154_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->alt = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<2; ++i) {
     (*way)->cc[i] = *p++;
@@ -1957,7 +1957,7 @@ static void GPS_D154_Get(GPS_PWay* way, UC* s)
 static void GPS_D155_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -1967,12 +1967,12 @@ static void GPS_D155_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -1992,7 +1992,7 @@ static void GPS_D155_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->alt = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<2; ++i) {
     (*way)->cc[i] = *p++;
@@ -2003,7 +2003,7 @@ static void GPS_D155_Get(GPS_PWay* way, UC* s)
   (*way)->wpt_class = *p++;
 
   (*way)->smbl = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   (*way)->dspl = *p;
 
@@ -2048,7 +2048,7 @@ void GPS_D120_Get(int cat_num, char* s)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D100_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D100_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
 
@@ -2056,11 +2056,11 @@ static void GPS_D100_Send(UC* data, GPS_PWay way, int32* len)
 
   copy_char_array(&p, way->ident, 6, UpperYes);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   copy_char_array(&p, way->cmnt, 40, UpperYes);
 
   *len = 58;
@@ -2079,7 +2079,7 @@ static void GPS_D100_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D101_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D101_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
 
@@ -2087,11 +2087,11 @@ static void GPS_D101_Send(UC* data, GPS_PWay way, int32* len)
 
   copy_char_array(&p, way->ident, 6, UpperYes);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   copy_char_array(&p, way->cmnt, 40, UpperYes);
 
 
@@ -2116,7 +2116,7 @@ static void GPS_D101_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D102_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D102_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
 
@@ -2124,11 +2124,11 @@ static void GPS_D102_Send(UC* data, GPS_PWay way, int32* len)
 
   copy_char_array(&p, way->ident, 6, UpperYes);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   copy_char_array(&p, way->cmnt, 40, UpperYes);
 
   GPS_Util_Put_Float(p,way->dst);
@@ -2152,7 +2152,7 @@ static void GPS_D102_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D103_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D103_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
 
@@ -2161,11 +2161,11 @@ static void GPS_D103_Send(UC* data, GPS_PWay way, int32* len)
   copy_char_array(&p, way->ident, 6, UpperYes);
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   copy_char_array(&p, way->cmnt, 40, UpperYes);
 
   *p++ = (UC) way->smbl;
@@ -2187,7 +2187,7 @@ static void GPS_D103_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D104_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D104_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
 
@@ -2195,11 +2195,11 @@ static void GPS_D104_Send(UC* data, GPS_PWay way, int32* len)
 
   copy_char_array(&p, way->ident, 6, UpperYes);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   /* byonke confirms that sending lower case comment data to a III+
    * results in the comment being truncated there.   So we uppercase
    * the entire comment.
@@ -2209,8 +2209,8 @@ static void GPS_D104_Send(UC* data, GPS_PWay way, int32* len)
   GPS_Util_Put_Float(p,way->dst);
   p+= sizeof(float);
 
-  GPS_Util_Put_Short(p, (int16) way->smbl);
-  p+=sizeof(int16);
+  GPS_Util_Put_Short(p, (int16_t) way->smbl);
+  p+=sizeof(int16_t);
 
   *p = 3; /* display symbol with waypoint name */
 
@@ -2230,7 +2230,7 @@ static void GPS_D104_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D105_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D105_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
   UC* q;
@@ -2238,12 +2238,12 @@ static void GPS_D105_Send(UC* data, GPS_PWay way, int32* len)
   p = data;
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  GPS_Util_Put_Short(p, (int16) way->smbl);
-  p+=sizeof(int16);
+  GPS_Util_Put_Short(p, (int16_t) way->smbl);
+  p+=sizeof(int16_t);
 
   q = (UC*) way->wpt_ident;
   while ((*p++ = *q++));
@@ -2265,11 +2265,11 @@ static void GPS_D105_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D106_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D106_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
   UC* q;
-  int32 i;
+  int32_t i;
 
   p = data;
 
@@ -2278,12 +2278,12 @@ static void GPS_D106_Send(UC* data, GPS_PWay way, int32* len)
     *p++ = way->subclass[i];
   }
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  GPS_Util_Put_Short(p, (int16) way->smbl);
-  p+=sizeof(int16);
+  GPS_Util_Put_Short(p, (int16_t) way->smbl);
+  p+=sizeof(int16_t);
 
   q = (UC*) way->wpt_ident;
   while ((*p++ = *q++));
@@ -2306,7 +2306,7 @@ static void GPS_D106_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D107_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D107_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
 
@@ -2314,11 +2314,11 @@ static void GPS_D107_Send(UC* data, GPS_PWay way, int32* len)
 
   copy_char_array(&p, way->ident, 6, UpperYes);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   copy_char_array(&p, way->cmnt, 40, UpperYes);
 
   *p++ = way->smbl;
@@ -2346,12 +2346,12 @@ static void GPS_D107_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D108_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D108_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
   UC* q;
 
-  int32 i;
+  int32_t i;
 
   p = data;
 
@@ -2360,14 +2360,14 @@ static void GPS_D108_Send(UC* data, GPS_PWay way, int32* len)
   *p++ = way->dspl;
   *p++ = 0x60;
   GPS_Util_Put_Short(p,(US) way->smbl);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
   for (i=0; i<18; ++i) {
     *p++ = way->subclass[i];
   }
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   if (way->alt_is_unknown) {
     GPS_Util_Put_Float(p, 1.0e25f);
@@ -2424,12 +2424,12 @@ static void GPS_D108_Send(UC* data, GPS_PWay way, int32* len)
 ** @return [void]
 ** D109's and D110's are so similar, we handle them with the same code.
 ************************************************************************/
-static void GPS_D109_Send(UC* data, GPS_PWay way, int32* len, int protoid)
+static void GPS_D109_Send(UC* data, GPS_PWay way, int32_t* len, int protoid)
 {
   UC* p;
   UC* q;
 
-  int32 i;
+  int32_t i;
 
   p = data;
 
@@ -2446,14 +2446,14 @@ static void GPS_D109_Send(UC* data, GPS_PWay way, int32* len, int protoid)
     GPS_Warning("Unknown protoid in GPS_D109_Send.");
   }
   GPS_Util_Put_Short(p,(US) way->smbl);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
   for (i=0; i<18; ++i) {
     *p++ = way->subclass[i];
   }
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   if (way->alt_is_unknown) {
     GPS_Util_Put_Float(p, 1.0e25f);
   } else {
@@ -2482,7 +2482,7 @@ static void GPS_D109_Send(UC* data, GPS_PWay way, int32* len, int protoid)
 
     if (way->time_populated) {
       GPS_Util_Put_Uint(p,GPS_Math_Utime_To_Gtime(way->time));
-      p+=sizeof(uint32);
+      p+=sizeof(uint32_t);
     } else {
       for (i=0; i<4; ++i) {
         *p++ = 0xff;  /* unknown time*/
@@ -2526,10 +2526,10 @@ static void GPS_D109_Send(UC* data, GPS_PWay way, int32* len, int protoid)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D150_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D150_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = data;
 
@@ -2544,12 +2544,12 @@ static void GPS_D150_Send(UC* data, GPS_PWay way, int32* len)
   *p++ = way->wpt_class;
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   GPS_Util_Put_Short(p,(US) way->alt);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   copy_char_array(&p, way->city, 24, UpperYes);
   copy_char_array(&p, way->state, 2, UpperYes);
@@ -2572,21 +2572,21 @@ static void GPS_D150_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D151_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D151_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = data;
 
   copy_char_array(&p, way->ident, 6, UpperYes);
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   copy_char_array(&p, way->cmnt, 40, UpperYes);
   GPS_Util_Put_Float(p,way->dst);
   p+=sizeof(float);
@@ -2596,7 +2596,7 @@ static void GPS_D151_Send(UC* data, GPS_PWay way, int32* len)
   copy_char_array(&p, way->state, 2, UpperYes);
 
   GPS_Util_Put_Short(p,(US) way->alt);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<2; ++i) {
     *p++ = way->cc[i];
@@ -2625,21 +2625,21 @@ static void GPS_D151_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D152_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D152_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = data;
 
   copy_char_array(&p, way->ident, 6, UpperYes);
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   copy_char_array(&p, way->cmnt, 40, UpperYes);
   GPS_Util_Put_Float(p,way->dst);
   p+=sizeof(float);
@@ -2649,7 +2649,7 @@ static void GPS_D152_Send(UC* data, GPS_PWay way, int32* len)
   copy_char_array(&p, way->state, 2, UpperYes);
 
   GPS_Util_Put_Short(p,(US) way->alt);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<2; ++i) {
     *p++ = way->cc[i];
@@ -2677,21 +2677,21 @@ static void GPS_D152_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D154_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D154_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = data;
 
   copy_char_array(&p, way->ident, 6, UpperYes);
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   copy_char_array(&p, way->cmnt, 40, UpperYes);
 
   GPS_Util_Put_Float(p,way->dst);
@@ -2702,7 +2702,7 @@ static void GPS_D154_Send(UC* data, GPS_PWay way, int32* len)
   copy_char_array(&p, way->state, 2, UpperYes);
 
   GPS_Util_Put_Short(p,(US) way->alt);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<2; ++i) {
     *p++ = way->cc[i];
@@ -2714,7 +2714,7 @@ static void GPS_D154_Send(UC* data, GPS_PWay way, int32* len)
   }
   *p++   = way->wpt_class;
 
-  GPS_Util_Put_Short(p,(int16)way->smbl);
+  GPS_Util_Put_Short(p,(int16_t)way->smbl);
 
   *len = 126;
 
@@ -2733,7 +2733,7 @@ static void GPS_D154_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D155_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D155_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
 
@@ -2742,11 +2742,11 @@ static void GPS_D155_Send(UC* data, GPS_PWay way, int32* len)
   copy_char_array(&p, way->ident, 6, UpperYes);
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   copy_char_array(&p, way->cmnt, 40, UpperYes);
   GPS_Util_Put_Float(p,way->dst);
   p+=sizeof(float);
@@ -2756,7 +2756,7 @@ static void GPS_D155_Send(UC* data, GPS_PWay way, int32* len)
   copy_char_array(&p, way->state, 2, UpperYes);
 
   GPS_Util_Put_Short(p,(US) way->alt);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   copy_char_array(&p, way->cc, 2, UpperYes);
   *p++ = 0;
@@ -2764,8 +2764,8 @@ static void GPS_D155_Send(UC* data, GPS_PWay way, int32* len)
   /* Ignore wpt_class; our D155 points are always user type which is "4". */
   *p++ = 4;
 
-  GPS_Util_Put_Short(p,(int16)way->smbl);
-  p+=sizeof(int16);
+  GPS_Util_Put_Short(p,(int16_t)way->smbl);
+  p+=sizeof(int16_t);
 
   *p = way->dspl;
 
@@ -2785,14 +2785,14 @@ static void GPS_D155_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [int32] number of waypoint entries
 ************************************************************************/
-int32 GPS_A200_Get(const char* port, GPS_PWay** way)
+int32_t GPS_A200_Get(const char* port, GPS_PWay** way)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 n;
-  int32 i;
+  int32_t n;
+  int32_t i;
 
 
   if (!GPS_Device_On(port,&fd)) {
@@ -2957,14 +2957,14 @@ int32 GPS_A200_Get(const char* port, GPS_PWay** way)
 **
 ** @return [int32] number of waypoint entries
 ************************************************************************/
-int32 GPS_A201_Get(const char* port, GPS_PWay** way)
+int32_t GPS_A201_Get(const char* port, GPS_PWay** way)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 n;
-  int32 i;
+  int32_t n;
+  int32_t i;
 
 
   if (!GPS_Device_On(port,&fd)) {
@@ -3146,14 +3146,14 @@ int32 GPS_A201_Get(const char* port, GPS_PWay** way)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A200_Send(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_A200_Send(const char* port, GPS_PWay* way, int32_t n)
 {
   UC data[GPS_ARB_LEN];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
+  int32_t i;
+  int32_t len;
   US  method;
 
   if (!GPS_Device_On(port,&fd)) {
@@ -3285,14 +3285,14 @@ int32 GPS_A200_Send(const char* port, GPS_PWay* way, int32 n)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A201_Send(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_A201_Send(const char* port, GPS_PWay* way, int32_t n)
 {
   UC data[GPS_ARB_LEN];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
+  int32_t i;
+  int32_t len;
   US  method;
 
   if (!GPS_Device_On(port,&fd)) {
@@ -3465,7 +3465,7 @@ static void GPS_D200_Get(GPS_PWay* way, const UC* s)
 static void GPS_D201_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -3524,12 +3524,12 @@ static void GPS_D210_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
   UC* q;
-  int32 i;
+  int32_t i;
 
   p=s;
 
   (*way)->rte_link_class = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
   for (i=0; i<18; ++i) {
     (*way)->rte_link_subclass[i] = *p++;
   }
@@ -3551,7 +3551,7 @@ static void GPS_D210_Get(GPS_PWay* way, UC* s)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D200_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D200_Send(UC* data, GPS_PWay way, int32_t* len)
 {
 
   *data = way->rte_num;
@@ -3572,7 +3572,7 @@ static void GPS_D200_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D201_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D201_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
 
@@ -3597,7 +3597,7 @@ static void GPS_D201_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D202_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D202_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
   UC* q;
@@ -3624,16 +3624,16 @@ static void GPS_D202_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D210_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D210_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
   UC* q;
-  int32 i;
+  int32_t i;
 
   p = data;
 
   GPS_Util_Put_Short(p,(US) way->rte_link_class);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
   for (i=0; i<18; ++i) {
     *p++ = way->rte_link_subclass[i];
   }
@@ -3657,15 +3657,15 @@ static void GPS_D210_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [int32] number of track entries
 ************************************************************************/
-int32 GPS_A300_Get(const char* port , GPS_PTrack** trk, pcb_fn /*unused*/)
+int32_t GPS_A300_Get(const char* port, GPS_PTrack** trk, pcb_fn /*unused*/)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 n;
-  int32 i;
-  int32 ret;
+  int32_t n;
+  int32_t i;
+  int32_t ret;
 
 
   if (gps_trk_transfer == -1) {
@@ -3791,16 +3791,16 @@ drain_run_cmd(gpsdevh* fd)
 **
 ** @return [int32] number of track entries
 ************************************************************************/
-int32 GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid)
+int32_t GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 n;
-  int32 i;
+  int32_t n;
+  int32_t i;
   US Pid_Trk_Data, Pid_Trk_Hdr, Cmnd_Transfer_Trk;
-  int32 trk_type, trk_hdr_type;
+  int32_t trk_type, trk_hdr_type;
 
   if (gps_trk_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -3971,14 +3971,14 @@ int32 GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A300_Send(const char* port, GPS_PTrack* trk, int32 n)
+int32_t GPS_A300_Send(const char* port, GPS_PTrack* trk, int32_t n)
 {
   UC data[GPS_ARB_LEN];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
+  int32_t i;
+  int32_t len;
 
   if (gps_trk_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -4063,17 +4063,17 @@ int32 GPS_A300_Send(const char* port, GPS_PTrack* trk, int32 n)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A301_Send(const char* port, GPS_PTrack* trk, int32 n, int protoid,
-                    gpsdevh* fd)
+int32_t GPS_A301_Send(const char* port, GPS_PTrack* trk, int32_t n, int protoid,
+                      gpsdevh* fd)
 {
   UC data[GPS_ARB_LEN];
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
+  int32_t i;
+  int32_t len;
   US  method;
   US Pid_Trk_Data, Pid_Trk_Hdr, Cmnd_Transfer_Trk;
-  int32 trk_type, trk_hdr_type;
+  int32_t trk_type, trk_hdr_type;
 
   if (gps_trk_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -4202,11 +4202,11 @@ int32 GPS_A301_Send(const char* port, GPS_PTrack* trk, int32 n, int protoid,
 **
 ** @return [int32] number of entries read
 ************************************************************************/
-int32 GPS_D300_Get(GPS_PTrack* trk, int32 entries, gpsdevh* fd)
+int32_t GPS_D300_Get(GPS_PTrack* trk, int32_t entries, gpsdevh* fd)
 {
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
+  int32_t i;
 
 
   for (i=0; i<entries; ++i) {
@@ -4269,15 +4269,15 @@ void GPS_D300b_Get(GPS_PTrack* trk, UC* data)
 void GPS_D301b_Get(GPS_PTrack* trk, UC* data)
 {
   UC* p;
-  uint32 t;
+  uint32_t t;
 
   p=data;
 
   (*trk)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*trk)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   t = GPS_Util_Get_Uint(p);
   if (!t || t==0x7fffffff || t==0xffffffff) {
@@ -4285,7 +4285,7 @@ void GPS_D301b_Get(GPS_PTrack* trk, UC* data)
   } else {
     (*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
   }
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   (*trk)->alt = GPS_Util_Get_Float(p);
   p+=sizeof(float);
@@ -4310,16 +4310,16 @@ void GPS_D301b_Get(GPS_PTrack* trk, UC* data)
 void GPS_D302b_Get(GPS_PTrack* trk, UC* data)
 {
   UC* p;
-  uint32 t;
+  uint32_t t;
   double gps_temp;
 
   p=data;
 
   (*trk)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*trk)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   t = GPS_Util_Get_Uint(p);
   if (!t || t==0x7fffffff || t==0xffffffff) {
@@ -4327,7 +4327,7 @@ void GPS_D302b_Get(GPS_PTrack* trk, UC* data)
   } else {
     (*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
   }
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   (*trk)->alt = GPS_Util_Get_Float(p);
   p+=sizeof(float);
@@ -4364,8 +4364,8 @@ void GPS_D302b_Get(GPS_PTrack* trk, UC* data)
 void GPS_D303b_Get(GPS_PTrack* trk, UC* data)
 {
   UC* p;
-  uint32 t;
-  uint32 raw_lat, raw_lon;
+  uint32_t t;
+  uint32_t raw_lat, raw_lon;
   int lat_undefined, lon_undefined;
   p=data;
 
@@ -4381,7 +4381,7 @@ void GPS_D303b_Get(GPS_PTrack* trk, UC* data)
   } else {
     (*trk)->lat = GPS_Math_Semi_To_Deg(raw_lat);
   }
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   raw_lon = GPS_Util_Get_Int(p);
   lon_undefined = !raw_lon || raw_lon==0x7fffffff || raw_lon==0xffffffff;
@@ -4390,7 +4390,7 @@ void GPS_D303b_Get(GPS_PTrack* trk, UC* data)
   } else {
     (*trk)->lon = GPS_Math_Semi_To_Deg(raw_lon);
   }
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   /*
    * Let the caller decide if it wants to toss trackpionts with only
@@ -4411,7 +4411,7 @@ void GPS_D303b_Get(GPS_PTrack* trk, UC* data)
   } else {
     (*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
   }
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   (*trk)->alt = GPS_Util_Get_Float(p);
   p+=sizeof(float);
@@ -4502,7 +4502,7 @@ void GPS_D311_Get(GPS_PTrack* trk, UC* s)
 **
 ** @return [void]
 ************************************************************************/
-void GPS_D300_Send(UC* data, GPS_PTrack trk, int32* len)
+void GPS_D300_Send(UC* data, GPS_PTrack trk, int32_t* len)
 {
   UC* p;
 
@@ -4527,7 +4527,7 @@ void GPS_D300_Send(UC* data, GPS_PTrack trk, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-void GPS_D301_Send(UC* data, GPS_PTrack trk, int32* len, int type)
+void GPS_D301_Send(UC* data, GPS_PTrack trk, int32_t* len, int type)
 {
   UC* p;
 
@@ -4566,7 +4566,7 @@ void GPS_D301_Send(UC* data, GPS_PTrack trk, int32* len, int type)
 **
 ** @return [void]
 ************************************************************************/
-void GPS_D303_Send(UC* data, GPS_PTrack trk, int32* len, int protoid)
+void GPS_D303_Send(UC* data, GPS_PTrack trk, int32_t* len, int protoid)
 {
   UC* p;
 
@@ -4606,7 +4606,7 @@ void GPS_D303_Send(UC* data, GPS_PTrack trk, int32* len, int protoid)
 **
 ** @return [void]
 ************************************************************************/
-void GPS_D311_Send(UC* data, GPS_PTrack trk, int32* len)
+void GPS_D311_Send(UC* data, GPS_PTrack trk, int32_t* len)
 {
   UC* p;
 
@@ -4626,7 +4626,7 @@ void GPS_D311_Send(UC* data, GPS_PTrack trk, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-void GPS_D310_Send(UC* data, GPS_PTrack trk, int32* len)
+void GPS_D310_Send(UC* data, GPS_PTrack trk, int32_t* len)
 {
   UC* p;
   UC* q;
@@ -4655,15 +4655,15 @@ void GPS_D310_Send(UC* data, GPS_PTrack trk, int32* len)
 static void GPS_A300_Translate(UC* s, GPS_PTrack* trk)
 {
   UC* p;
-  uint32 t;
+  uint32_t t;
 
   p=s;
 
   (*trk)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*trk)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   t = GPS_Util_Get_Uint(p);
   if (!t || t==0x7fffffff || t==0xffffffff) {
@@ -4671,7 +4671,7 @@ static void GPS_A300_Translate(UC* s, GPS_PTrack* trk)
   } else {
     (*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
   }
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   (*trk)->tnew = *p;
 }
@@ -4697,13 +4697,13 @@ static void GPS_A300_Encode(UC* s, GPS_PTrack trk)
    * caller shouldn't set no_latlon unless one of these protocols actually
    * is in use */
   GPS_Util_Put_Int(p,trk->no_latlon ? 0x7fffffff : GPS_Math_Deg_To_Semi(trk->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   GPS_Util_Put_Int(p,trk->no_latlon ? 0x7fffffff : GPS_Math_Deg_To_Semi(trk->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   GPS_Util_Put_Uint(p,GPS_Math_Utime_To_Gtime(trk->Time));
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   *p = (UC) trk->tnew;
 }
@@ -4719,14 +4719,14 @@ static void GPS_A300_Encode(UC* s, GPS_PTrack trk)
 **
 ** @return [int32] number of waypoint entries
 ************************************************************************/
-int32 GPS_A400_Get(const char* port, GPS_PWay** way)
+int32_t GPS_A400_Get(const char* port, GPS_PWay** way)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 n;
-  int32 i;
+  int32_t n;
+  int32_t i;
 
   if (gps_prx_waypt_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -4880,14 +4880,14 @@ int32 GPS_A400_Get(const char* port, GPS_PWay** way)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A400_Send(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_A400_Send(const char* port, GPS_PWay* way, int32_t n)
 {
   UC data[GPS_ARB_LEN];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
+  int32_t i;
+  int32_t len;
 
   if (gps_prx_waypt_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -5004,7 +5004,7 @@ int32 GPS_A400_Send(const char* port, GPS_PWay* way, int32 n)
 static void GPS_D400_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -5014,12 +5014,12 @@ static void GPS_D400_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -5041,7 +5041,7 @@ static void GPS_D400_Get(GPS_PWay* way, UC* s)
 static void GPS_D403_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
@@ -5051,12 +5051,12 @@ static void GPS_D403_Get(GPS_PWay* way, UC* s)
   }
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   for (i=0; i<40; ++i) {
     (*way)->cmnt[i] = *p++;
@@ -5081,14 +5081,14 @@ static void GPS_D403_Get(GPS_PWay* way, UC* s)
 static void GPS_D450_Get(GPS_PWay* way, UC* s)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p=s;
 
   (*way)->prot = 450;
 
   (*way)->idx = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<6; ++i) {
     (*way)->ident[i] = *p++;
@@ -5099,13 +5099,13 @@ static void GPS_D450_Get(GPS_PWay* way, UC* s)
   (*way)->wpt_class = *p++;
 
   (*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*way)->alt = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<24; ++i) {
     (*way)->city[i] = *p++;
@@ -5134,10 +5134,10 @@ static void GPS_D450_Get(GPS_PWay* way, UC* s)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D400_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D400_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = data;
 
@@ -5145,11 +5145,11 @@ static void GPS_D400_Send(UC* data, GPS_PWay way, int32* len)
     *p++ = way->ident[i];
   }
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   for (i=0; i<40; ++i) {
     *p++ = way->cmnt[i];
   }
@@ -5170,10 +5170,10 @@ static void GPS_D400_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D403_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D403_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = data;
 
@@ -5181,11 +5181,11 @@ static void GPS_D403_Send(UC* data, GPS_PWay way, int32* len)
     *p++ = way->ident[i];
   }
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   for (i=0; i<40; ++i) {
     *p++ = way->cmnt[i];
   }
@@ -5209,15 +5209,15 @@ static void GPS_D403_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [void]
 ************************************************************************/
-static void GPS_D450_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D450_Send(UC* data, GPS_PWay way, int32_t* len)
 {
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = data;
 
   GPS_Util_Put_Short(p,(US) way->idx);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<6; ++i) {
     *p++ = way->ident[i];
@@ -5228,12 +5228,12 @@ static void GPS_D450_Send(UC* data, GPS_PWay way, int32* len)
   *p++ = way->wpt_class;
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   GPS_Util_Put_Short(p,(US) way->alt);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   for (i=0; i<24; ++i) {
     *p++ = way->city[i];
@@ -5265,13 +5265,13 @@ static void GPS_D450_Send(UC* data, GPS_PWay way, int32* len)
 **
 ** @return [int32] number of almanac entries
 ************************************************************************/
-int32 GPS_A500_Get(const char* port, GPS_PAlmanac** alm)
+int32_t GPS_A500_Get(const char* port, GPS_PAlmanac** alm)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet trapkt;
   GPS_Packet recpkt;
-  int32 i, n;
+  int32_t i, n;
 
   if (gps_almanac_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -5377,17 +5377,17 @@ int32 GPS_A500_Get(const char* port, GPS_PAlmanac** alm)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32 n)
+int32_t GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32_t n)
 {
   UC data[GPS_ARB_LEN];
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
-  int32 timesent;
-  int32 posnsent;
-  int32 ret;
+  int32_t i;
+  int32_t len;
+  int32_t timesent;
+  int32_t posnsent;
+  int32_t ret;
 
   if (!GPS_Device_On(port, &fd)) {
     return gps_errno;
@@ -5556,7 +5556,7 @@ static void GPS_A500_Translate(UC* s, GPS_PAlmanac* alm)
   p=s;
 
   (*alm)->wn = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   (*alm)->toa = GPS_Util_Get_Float(p);
   p+=sizeof(float);
@@ -5686,7 +5686,7 @@ static void GPS_A500_Encode(UC* s, GPS_PAlmanac alm)
   p=s;
 
   GPS_Util_Put_Short(p,alm->wn);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   GPS_Util_Put_Float(p,alm->toa);
   p+=sizeof(float);
@@ -5786,13 +5786,13 @@ time_t GPS_A600_Get(const char* port)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A600_Send(const char* port, time_t Time)
+int32_t GPS_A600_Send(const char* port, time_t Time)
 {
   gpsdevh* fd;
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 posnsent=0;
-  int32 ret=0;
+  int32_t posnsent = 0;
+  int32_t ret = 0;
 
   if (!GPS_Device_On(port, &fd)) {
     return gps_errno;
@@ -5878,9 +5878,9 @@ time_t GPS_D600_Get(const GPS_Packet& packet)
 
   ts.tm_mon  = *p++ - 1;
   ts.tm_mday = *p++;
-  ts.tm_year = (int32) GPS_Util_Get_Short(p) - 1900;
+  ts.tm_year = (int32_t) GPS_Util_Get_Short(p) - 1900;
   p+=2;
-  ts.tm_hour = (int32) GPS_Util_Get_Short(p);
+  ts.tm_hour = (int32_t) GPS_Util_Get_Short(p);
   p+=2;
   ts.tm_min  = *p++;
   ts.tm_sec  = *p++;
@@ -5933,7 +5933,7 @@ void GPS_D600_Send(GPS_Packet& packet, time_t Time)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A700_Get(const char* port, double* lat, double* lon)
+int32_t GPS_A700_Get(const char* port, double* lat, double* lon)
 {
   static UC data[2];
   gpsdevh* fd;
@@ -5991,7 +5991,7 @@ int32 GPS_A700_Get(const char* port, double* lat, double* lon)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A700_Send(const char* port, double lat, double lon)
+int32_t GPS_A700_Send(const char* port, double lat, double lon)
 {
   gpsdevh* fd;
   GPS_Packet tra;
@@ -6094,7 +6094,7 @@ void GPS_D700_Send(GPS_Packet& packet, double lat, double lon)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A800_On(const char* port, gpsdevh** fd)
+int32_t GPS_A800_On(const char* port, gpsdevh** fd)
 {
   static UC data[2];
   GPS_Packet tra;
@@ -6131,7 +6131,7 @@ int32 GPS_A800_On(const char* port, gpsdevh** fd)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A800_Off(const char* /*unused*/, gpsdevh** fd)
+int32_t GPS_A800_Off(const char* /*unused*/, gpsdevh** fd)
 {
   static UC data[2];
   GPS_Packet tra;
@@ -6167,7 +6167,7 @@ int32 GPS_A800_Off(const char* /*unused*/, gpsdevh** fd)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet)
+int32_t GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet)
 {
   GPS_Packet tra;
   GPS_Packet rec;
@@ -6227,7 +6227,7 @@ void GPS_D800_Get(const GPS_Packet& packet, GPS_PPvt_Data* pvt)
   p+=sizeof(float);
 
   (*pvt)->fix = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   (*pvt)->tow = GPS_Util_Get_Double(p);
   p+=sizeof(double);
@@ -6251,7 +6251,7 @@ void GPS_D800_Get(const GPS_Packet& packet, GPS_PPvt_Data* pvt)
   p+=sizeof(float);
 
   (*pvt)->leap_scnds = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   (*pvt)->wn_days = GPS_Util_Get_Int(p);
 }
@@ -6266,13 +6266,13 @@ void GPS_D800_Get(const GPS_Packet& packet, GPS_PPvt_Data* pvt)
 ** @return [int32] number of lap entries
 ************************************************************************/
 
-int32 GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb)
+int32_t GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet trapkt;
   GPS_Packet recpkt;
-  int32 i, n;
+  int32_t i, n;
 
   if (gps_lap_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -6368,7 +6368,7 @@ int32 GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb)
 ************************************************************************/
 void GPS_D1011b_Get(GPS_PLap* Lap, UC* p)
 {
-  uint32 t;
+       uint32_t t;
 
   /* Lap index (not in D906) */
   switch (gps_lap_type) {
@@ -6377,13 +6377,13 @@ void GPS_D1011b_Get(GPS_PLap* Lap, UC* p)
     break;
   case pD1001:
     (*Lap)->index = GPS_Util_Get_Uint(p);
-    p+=sizeof(uint32);
+    p+=sizeof(uint32_t);
     break;
   case pD1011:
   case pD1015:
     (*Lap)->index = GPS_Util_Get_Short(p);
-    p+=sizeof(uint16);
-    p+=sizeof(uint16); /*unused*/
+    p+=sizeof(uint16_t);
+    p+=sizeof(uint16_t); /*unused*/
     break;
   default:
     break;
@@ -6391,10 +6391,10 @@ void GPS_D1011b_Get(GPS_PLap* Lap, UC* p)
 
   t = GPS_Util_Get_Uint(p);
   (*Lap)->start_time = GPS_Math_Gtime_To_Utime((time_t)t);
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   (*Lap)->total_time = GPS_Util_Get_Int(p);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*Lap)->total_distance = GPS_Util_Get_Float(p);
   p+=sizeof(float);
@@ -6404,16 +6404,16 @@ void GPS_D1011b_Get(GPS_PLap* Lap, UC* p)
   }
 
   (*Lap)->begin_lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   (*Lap)->begin_lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   (*Lap)->end_lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   (*Lap)->end_lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*Lap)->calories = GPS_Util_Get_Short(p);
-  p+=sizeof(int16);
+  p+=sizeof(int16_t);
 
   /* Track index, only in D906*/
   if (gps_lap_type == pD906) {
@@ -6478,7 +6478,7 @@ void GPS_D1011b_Get(GPS_PLap* Lap, UC* p)
 ** @return [int32] number of course entries
 ************************************************************************/
 
-int32  GPS_A1006_Get
+int32_t GPS_A1006_Get
 (const char* port,
  GPS_PCourse** crs,
  pcb_fn cb)
@@ -6488,7 +6488,7 @@ int32  GPS_A1006_Get
   gpsdevh* fd;
   GPS_Packet trapkt;
   GPS_Packet recpkt;
-  int32 i, n;
+  int32_t i, n;
 
   if (gps_course_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -6590,16 +6590,16 @@ int32  GPS_A1006_Get
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A1006_Send(const char* /*unused*/,
-                     GPS_PCourse* crs,
-                     int32 n_crs,
-                     gpsdevh* fd)
+int32_t GPS_A1006_Send(const char* /*unused*/,
+                       GPS_PCourse* crs,
+                       int32_t n_crs,
+                       gpsdevh* fd)
 {
   UC data[GPS_ARB_LEN];
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
+  int32_t i;
+  int32_t len;
 
   GPS_Util_Put_Short(data,(US) n_crs);
   GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
@@ -6664,13 +6664,13 @@ void GPS_D1006_Get(GPS_PCourse* crs, UC* p)
 {
   int i;
   (*crs)->index = GPS_Util_Get_Short(p);
-  p+=sizeof(uint16);
-  p+=sizeof(uint16); // unused
+  p+=sizeof(uint16_t);
+  p+=sizeof(uint16_t); // unused
   for (i=0; i<16; ++i) {
     (*crs)->course_name[i] = *p++;
   }
   (*crs)->track_index = GPS_Util_Get_Short(p);
-  p+=sizeof(uint16);
+  p+=sizeof(uint16_t);
 }
 
 
@@ -6684,7 +6684,7 @@ void GPS_D1006_Get(GPS_PCourse* crs, UC* p)
 **
 ** @return [void]
 ************************************************************************/
-void GPS_D1006_Send(UC* data, GPS_PCourse crs, int32* len)
+void GPS_D1006_Send(UC* data, GPS_PCourse crs, int32_t* len)
 {
   UC* p;
   int j;
@@ -6694,7 +6694,7 @@ void GPS_D1006_Send(UC* data, GPS_PCourse crs, int32* len)
   p += 2;
 
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(uint16);
+  p+=sizeof(uint16_t);
 
   for (j=0; j<16; ++j) {
     *p++ = crs->course_name[j];
@@ -6717,13 +6717,13 @@ void GPS_D1006_Send(UC* data, GPS_PCourse crs, int32* len)
 ** @return [int32] number of lap entries
 ************************************************************************/
 
-int32 GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb)
+int32_t GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet trapkt;
   GPS_Packet recpkt;
-  int32 i, n;
+  int32_t i, n;
 
   if (gps_course_lap_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -6825,16 +6825,16 @@ int32 GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A1007_Send(const char* /*unused*/,
-                     GPS_PCourse_Lap* clp,
-                     int32 n_clp,
-                     gpsdevh* fd)
+int32_t GPS_A1007_Send(const char* /*unused*/,
+                       GPS_PCourse_Lap* clp,
+                       int32_t n_clp,
+                       gpsdevh* fd)
 {
   UC data[GPS_ARB_LEN];
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
+  int32_t i;
+  int32_t len;
 
   GPS_Util_Put_Short(data,(US) n_clp);
   GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
@@ -6898,25 +6898,25 @@ int32 GPS_A1007_Send(const char* /*unused*/,
 void GPS_D1007_Get(GPS_PCourse_Lap* clp, UC* p)
 {
   (*clp)->course_index = GPS_Util_Get_Short(p);
-  p+=sizeof(uint16);
+  p+=sizeof(uint16_t);
 
   (*clp)->lap_index = GPS_Util_Get_Short(p);
-  p+=sizeof(uint16);
+  p+=sizeof(uint16_t);
 
   (*clp)->total_time = GPS_Util_Get_Int(p);
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   (*clp)->total_dist = GPS_Util_Get_Float(p);
   p+=sizeof(float);
 
   (*clp)->begin_lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   (*clp)->begin_lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   (*clp)->end_lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   (*clp)->end_lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   (*clp)->avg_heart_rate = *p++;
   (*clp)->max_heart_rate = *p++;
@@ -6938,7 +6938,7 @@ void GPS_D1007_Get(GPS_PCourse_Lap* clp, UC* p)
 **
 ** @return [void]
 ************************************************************************/
-void GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32* len)
+void GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32_t* len)
 {
   UC* p;
   p = data;
@@ -6950,20 +6950,20 @@ void GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32* len)
   p += 2;
 
   GPS_Util_Put_Uint(p, clp->total_time);
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   GPS_Util_Put_Float(p,clp->total_dist);
   p+= sizeof(float);
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(clp->begin_lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(clp->begin_lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(clp->end_lat));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
   GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(clp->end_lon));
-  p+=sizeof(int32);
+  p+=sizeof(int32_t);
 
   *p++ = clp->avg_heart_rate;
 
@@ -6987,13 +6987,13 @@ void GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32* len)
 ** @return [int32] number of course point entries
 ************************************************************************/
 
-int32 GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb)
+int32_t GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb)
 {
   static UC data[2];
   gpsdevh* fd;
   GPS_Packet trapkt;
   GPS_Packet recpkt;
-  int32 i, n;
+  int32_t i, n;
 
   if (gps_course_point_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -7096,16 +7096,16 @@ int32 GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb)
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A1008_Send(const char* /*unused*/,
-                     GPS_PCourse_Point* cpt,
-                     int32 n_cpt,
-                     gpsdevh* fd)
+int32_t GPS_A1008_Send(const char* /*unused*/,
+                       GPS_PCourse_Point* cpt,
+                       int32_t n_cpt,
+                       gpsdevh* fd)
 {
   UC data[GPS_ARB_LEN];
   GPS_Packet tra;
   GPS_Packet rec;
-  int32 i;
-  int32 len;
+  int32_t i;
+  int32_t len;
 
   GPS_Util_Put_Short(data,(US) n_cpt);
   GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
@@ -7169,19 +7169,19 @@ int32 GPS_A1008_Send(const char* /*unused*/,
 void GPS_D1012_Get(GPS_PCourse_Point* cpt, UC* p)
 {
   int i;
-  uint32 t;
+  uint32_t t;
 
   for (i=0; i<11; ++i) {
     (*cpt)->name[i] = *p++;
   }
   p++; //unused
   (*cpt)->course_index = GPS_Util_Get_Short(p);
-  p+=sizeof(uint16);
-  p+=sizeof(uint16); // unused
+  p+=sizeof(uint16_t);
+  p+=sizeof(uint16_t); // unused
 
   t = GPS_Util_Get_Uint(p);
   (*cpt)->track_point_time = GPS_Math_Gtime_To_Utime((time_t)t);
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   (*cpt)->point_type = *p++;
 
@@ -7198,7 +7198,7 @@ void GPS_D1012_Get(GPS_PCourse_Point* cpt, UC* p)
 **
 ** @return [void]
 ************************************************************************/
-void GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32* len)
+void GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32_t* len)
 {
   UC* p;
   int j;
@@ -7215,10 +7215,10 @@ void GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32* len)
   p += 2;
 
   GPS_Util_Put_Uint(p,0);
-  p+=sizeof(uint16);
+  p+=sizeof(uint16_t);
 
   GPS_Util_Put_Uint(p,GPS_Math_Utime_To_Gtime(cpt->track_point_time));
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   *p++ = cpt->point_type;
 
@@ -7236,7 +7236,7 @@ void GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32* len)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits)
+int32_t GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits)
 {
   static UC data[2];
   gpsdevh* fd;
@@ -7297,16 +7297,16 @@ int32 GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits)
 void GPS_D1013_Get(GPS_PCourse_Limits limits, UC* p)
 {
   limits->max_courses = GPS_Util_Get_Uint(p);
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   limits->max_course_laps = GPS_Util_Get_Uint(p);
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   limits->max_course_pnt = GPS_Util_Get_Uint(p);
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 
   limits->max_course_trk_pnt = GPS_Util_Get_Uint(p);
-  p+=sizeof(uint32);
+  p+=sizeof(uint32_t);
 }
 
 
@@ -7548,7 +7548,7 @@ static UC Is_Trackpoint_Invalid(GPS_PTrack trk)
 ** @param [r] trk [GPS_PTrack **] track
 ** @param [r] n [int32 *] Number of trackpoints
 ************************************************************************/
-void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32* n)
+void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32_t* n)
 {
   /* D303/304 marks track segments with two consecutive invalid track
    * points instead of the tnew flag. Create them unless we're at the
@@ -7557,12 +7557,12 @@ void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32* n)
    * done here because it will change the number of track points.
    */
   if (gps_trk_type == pD303 || gps_trk_type == pD304) {
-    for (int32 i=0; i<*n; ++i) {
+    for (int32_t i = 0; i<*n; ++i) {
       if ((*trk)[i]->tnew && i>0 && !(*trk)[i]->ishdr && !(*trk)[i-1]->ishdr) {
         /* Create invalid points based on the data from the point
          * marked with tnew and the one before it.
          */
-        for (int32 j=i-1; j<=i; ++j) {
+        for (int32_t j = i - 1; j<=i; ++j) {
           if (!Is_Trackpoint_Invalid((*trk)[j])) {
             GPS_PTrack trkpt = GPS_Track_New();
             *trkpt = *((*trk)[j]);
@@ -7584,7 +7584,7 @@ void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32* n)
   }
 }
 
-int32 GPS_Set_Baud_Rate(const char* port, int br)
+int32_t GPS_Set_Baud_Rate(const char* port, int br)
 {
 
   gpsdevh* fd;
index 12b33a211fc48e1e65dd9250152a4b229378a228..00f2736bb5605ada8ef40571f3406a816c6db122 100644 (file)
@@ -4,79 +4,79 @@
 
 #include "jeeps/gps.h"
 
-  int32  GPS_Init(const char* port);
+int32_t GPS_Init(const char* port);
 
-  int32  GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int ct, GPS_PWay*));
-  int32 GPS_A101_Get(const char* port);
-  int32  GPS_A100_Send(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_PWay*));
+int32_t GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int ct, GPS_PWay*));
+int32_t GPS_A101_Get(const char* port);
+int32_t GPS_A100_Send(const char* port, GPS_PWay* way, int32_t n, int (*cb)(GPS_PWay*));
 
-  int32  GPS_A200_Get(const char* port, GPS_PWay** way);
-  int32  GPS_A201_Get(const char* port, GPS_PWay** way);
-  int32  GPS_A200_Send(const char* port, GPS_PWay* way, int32 n);
-  int32  GPS_A201_Send(const char* port, GPS_PWay* way, int32 n);
+int32_t GPS_A200_Get(const char* port, GPS_PWay** way);
+int32_t GPS_A201_Get(const char* port, GPS_PWay** way);
+int32_t GPS_A200_Send(const char* port, GPS_PWay* way, int32_t n);
+int32_t GPS_A201_Send(const char* port, GPS_PWay* way, int32_t n);
 
-  int32  GPS_A300_Get(const char* port, GPS_PTrack** trk, pcb_fn cb);
-  int32  GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid);
-  int32  GPS_A300_Send(const char* port, GPS_PTrack* trk, int32 n);
-  int32  GPS_A301_Send(const char* port, GPS_PTrack* trk, int32 n, int protoid,
-                       gpsdevh* fd);
+int32_t GPS_A300_Get(const char* port, GPS_PTrack** trk, pcb_fn cb);
+int32_t GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid);
+int32_t GPS_A300_Send(const char* port, GPS_PTrack* trk, int32_t n);
+int32_t GPS_A301_Send(const char* port, GPS_PTrack* trk, int32_t n, int protoid,
+                      gpsdevh* fd);
 
-  int32  GPS_D300_Get(GPS_PTrack* trk, int32 entries, gpsdevh* h);
+int32_t GPS_D300_Get(GPS_PTrack* trk, int32_t entries, gpsdevh* h);
   void   GPS_D300b_Get(GPS_PTrack* trk, UC* data);
   void   GPS_D301b_Get(GPS_PTrack* trk, UC* data);
   void   GPS_D302b_Get(GPS_PTrack* trk, UC* data);
   void   GPS_D303b_Get(GPS_PTrack* trk, UC* data); /*D304*/
   void   GPS_D310_Get(GPS_PTrack* trk, UC* s);
   void   GPS_D311_Get(GPS_PTrack* trk, UC* s);
-  void   GPS_D300_Send(UC* data, GPS_PTrack trk, int32* len);
-  void   GPS_D301_Send(UC* data, GPS_PTrack trk, int32* len, int type);
-  void   GPS_D303_Send(UC* data, GPS_PTrack trk, int32* len, int protoid);
-  void   GPS_D310_Send(UC* data, GPS_PTrack trk, int32* len);
-  void   GPS_D311_Send(UC* data, GPS_PTrack trk, int32* len);
+  void   GPS_D300_Send(UC* data, GPS_PTrack trk, int32_t* len);
+  void   GPS_D301_Send(UC* data, GPS_PTrack trk, int32_t* len, int type);
+  void   GPS_D303_Send(UC* data, GPS_PTrack trk, int32_t* len, int protoid);
+  void   GPS_D310_Send(UC* data, GPS_PTrack trk, int32_t* len);
+  void   GPS_D311_Send(UC* data, GPS_PTrack trk, int32_t* len);
 
-  int32  GPS_A400_Get(const char* port, GPS_PWay** way);
-  int32  GPS_A400_Send(const char* port, GPS_PWay* way, int32 n);
+int32_t GPS_A400_Get(const char* port, GPS_PWay** way);
+int32_t GPS_A400_Send(const char* port, GPS_PWay* way, int32_t n);
 
-  int32  GPS_A500_Get(const char* port, GPS_PAlmanac** alm);
-  int32  GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32 n);
+int32_t GPS_A500_Get(const char* port, GPS_PAlmanac** alm);
+int32_t GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32_t n);
 
   time_t GPS_A600_Get(const char* port);
   time_t GPS_D600_Get(const GPS_Packet& packet);
-  int32  GPS_A600_Send(const char* port, time_t Time);
+int32_t GPS_A600_Send(const char* port, time_t Time);
   void   GPS_D600_Send(GPS_Packet& packet, time_t Time);
 
-  int32  GPS_A700_Get(const char* port, double* lat, double* lon);
-  int32  GPS_A700_Send(const char* port, double lat, double lon);
+int32_t GPS_A700_Get(const char* port, double* lat, double* lon);
+int32_t GPS_A700_Send(const char* port, double lat, double lon);
   void   GPS_D700_Get(const GPS_Packet& packet, double* lat, double* lon);
   void   GPS_D700_Send(GPS_Packet& packet, double lat, double lon);
 
-  int32  GPS_A800_On(const char* port, gpsdevh** fd);
-  int32  GPS_A800_Off(const char* port, gpsdevh** fd);
-  int32  GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet);
+int32_t GPS_A800_On(const char* port, gpsdevh** fd);
+int32_t GPS_A800_Off(const char* port, gpsdevh** fd);
+int32_t GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet);
   void   GPS_D800_Get(const GPS_Packet& packet, GPS_PPvt_Data* pvt);
 
-  int32  GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb);
+int32_t GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb);
   void   GPS_D1011b_Get(GPS_PLap* Lap,UC* data); /*D906 D1001 D1015*/
 
-  int32  GPS_A1006_Get(const char* port, GPS_PCourse** crs, pcb_fn cb);
-  int32  GPS_A1006_Send(const char* port, GPS_PCourse* crs, int32 n_crs,
-                        gpsdevh* fd);
+int32_t GPS_A1006_Get(const char* port, GPS_PCourse** crs, pcb_fn cb);
+int32_t GPS_A1006_Send(const char* port, GPS_PCourse* crs, int32_t n_crs,
+                       gpsdevh* fd);
   void   GPS_D1006_Get(GPS_PCourse* crs, UC* p);
-  void   GPS_D1006_Send(UC* data, GPS_PCourse crs, int32* len);
+  void   GPS_D1006_Send(UC* data, GPS_PCourse crs, int32_t* len);
 
-  int32  GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb);
-  int32  GPS_A1007_Send(const char* port, GPS_PCourse_Lap* clp, int32 n_clp,
-                        gpsdevh* fd);
+int32_t GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb);
+int32_t GPS_A1007_Send(const char* port, GPS_PCourse_Lap* clp, int32_t n_clp,
+                       gpsdevh* fd);
   void   GPS_D1007_Get(GPS_PCourse_Lap* clp, UC* p);
-  void   GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32* len);
+  void   GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32_t* len);
 
-  int32  GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb);
-  int32  GPS_A1008_Send(const char* port, GPS_PCourse_Point* cpt, int32 n_cpt,
-                        gpsdevh* fd);
+int32_t GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb);
+int32_t GPS_A1008_Send(const char* port, GPS_PCourse_Point* cpt, int32_t n_cpt,
+                       gpsdevh* fd);
   void   GPS_D1012_Get(GPS_PCourse_Point* cpt, UC* p);
-  void   GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32* len);
+  void   GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32_t* len);
 
-  int32  GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits);
+int32_t GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits);
   void   GPS_D1013_Get(GPS_PCourse_Limits limits, UC* p);
 
   /* Unhandled documented protocols, as of:
 
   const char* Get_Pkt_Type(US p, US d0, const char** xinfo);
 
-  void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32* n);
-  int32 GPS_Set_Baud_Rate(const char* port, int br);
+  void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32_t* n);
+int32_t GPS_Set_Baud_Rate(const char* port, int br);
 
 #endif // JEEPS_GPSAPP_H_INCLUDED_
index ca25a77332fe784a9bf810a126cf2cf8bd33e0c2..f6fe19e074c32f60e0034f575114274b9997183a 100644 (file)
@@ -37,7 +37,7 @@
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Off(const char* port)
+int32_t GPS_Command_Off(const char* port)
 {
   static UC data[2];
   gpsdevh* fd;
@@ -84,9 +84,9 @@ int32 GPS_Command_Off(const char* port)
 ** @return [int32] number of waypoint entries
 ************************************************************************/
 
-int32 GPS_Command_Get_Waypoint(const char* port, GPS_PWay** way, pcb_fn cb)
+int32_t GPS_Command_Get_Waypoint(const char* port, GPS_PWay** way, pcb_fn cb)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   /*
    * It's a bit tacky to do this up front without ticking the
@@ -126,9 +126,9 @@ int32 GPS_Command_Get_Waypoint(const char* port, GPS_PWay** way, pcb_fn cb)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Send_Waypoint(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_SWay**))
+int32_t GPS_Command_Send_Waypoint(const char* port, GPS_PWay* way, int32_t n, int (*cb)(GPS_SWay**))
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   switch (gps_waypt_transfer) {
   case pA100:
@@ -153,9 +153,9 @@ int32 GPS_Command_Send_Waypoint(const char* port, GPS_PWay* way, int32 n, int (*
 ** @return [int32] number of waypoint entries
 ************************************************************************/
 
-int32 GPS_Command_Get_Route(const char* port, GPS_PWay** way)
+int32_t GPS_Command_Get_Route(const char* port, GPS_PWay** way)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   switch (gps_route_transfer) {
   case pA200:
@@ -185,9 +185,9 @@ int32 GPS_Command_Get_Route(const char* port, GPS_PWay** way)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Send_Route(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_Command_Send_Route(const char* port, GPS_PWay* way, int32_t n)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
 
   switch (gps_route_transfer) {
@@ -216,9 +216,9 @@ int32 GPS_Command_Send_Route(const char* port, GPS_PWay* way, int32 n)
 ** @return [int32] number of track entries
 ************************************************************************/
 
-int32 GPS_Command_Get_Track(const char* port, GPS_PTrack** trk, pcb_fn cb)
+int32_t GPS_Command_Get_Track(const char* port, GPS_PTrack** trk, pcb_fn cb)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   if (gps_trk_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -253,9 +253,9 @@ int32 GPS_Command_Get_Track(const char* port, GPS_PTrack** trk, pcb_fn cb)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Send_Track(const char* port, GPS_PTrack* trk, int32 n, int eraset)
+int32_t GPS_Command_Send_Track(const char* port, GPS_PTrack* trk, int32_t n, int eraset)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   if (gps_trk_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -293,9 +293,9 @@ int32 GPS_Command_Send_Track(const char* port, GPS_PTrack* trk, int32 n, int era
 ** @return [int32] number of waypoint entries
 ************************************************************************/
 
-int32 GPS_Command_Get_Proximity(const char* port, GPS_PWay** way)
+int32_t GPS_Command_Get_Proximity(const char* port, GPS_PWay** way)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   if (gps_prx_waypt_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -326,9 +326,9 @@ int32 GPS_Command_Get_Proximity(const char* port, GPS_PWay** way)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Send_Proximity(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_Command_Send_Proximity(const char* port, GPS_PWay* way, int32_t n)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
 
   if (gps_prx_waypt_transfer == -1) {
@@ -360,9 +360,9 @@ int32 GPS_Command_Send_Proximity(const char* port, GPS_PWay* way, int32 n)
 ** @return [int32] number of almanac entries
 ************************************************************************/
 
-int32 GPS_Command_Get_Almanac(const char* port, GPS_PAlmanac** alm)
+int32_t GPS_Command_Get_Almanac(const char* port, GPS_PAlmanac** alm)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   if (gps_almanac_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -393,9 +393,9 @@ int32 GPS_Command_Get_Almanac(const char* port, GPS_PAlmanac** alm)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Send_Almanac(const char* port, GPS_PAlmanac* alm, int32 n)
+int32_t GPS_Command_Send_Almanac(const char* port, GPS_PAlmanac* alm, int32_t n)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   if (gps_almanac_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -458,7 +458,7 @@ time_t GPS_Command_Get_Time(const char* port)
 ** @return [int32] true if OK
 ************************************************************************/
 
-int32 GPS_Command_Send_Time(const char* port, time_t Time)
+int32_t GPS_Command_Send_Time(const char* port, time_t Time)
 {
   time_t ret=0;
 
@@ -488,9 +488,9 @@ int32 GPS_Command_Send_Time(const char* port, time_t Time)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Get_Position(const char* port, double* lat, double* lon)
+int32_t GPS_Command_Get_Position(const char* port, double* lat, double* lon)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   switch (gps_position_transfer) {
   case pA700:
@@ -524,9 +524,9 @@ int32 GPS_Command_Get_Position(const char* port, double* lat, double* lon)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Send_Position(const char* port, double lat, double lon)
+int32_t GPS_Command_Send_Position(const char* port, double lat, double lon)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   switch (gps_position_transfer) {
   case pA700:
@@ -551,9 +551,9 @@ int32 GPS_Command_Send_Position(const char* port, double lat, double lon)
 ** @return [int32] success if supported and GPS starts sending
 ************************************************************************/
 
-int32 GPS_Command_Pvt_On(const char* port, gpsdevh** fd)
+int32_t GPS_Command_Pvt_On(const char* port, gpsdevh** fd)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
 
   if (gps_pvt_transfer == -1) {
@@ -586,9 +586,9 @@ int32 GPS_Command_Pvt_On(const char* port, gpsdevh** fd)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Pvt_Off(const char* port, gpsdevh** fd)
+int32_t GPS_Command_Pvt_Off(const char* port, gpsdevh** fd)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
 
   if (gps_pvt_transfer == -1) {
@@ -619,9 +619,9 @@ int32 GPS_Command_Pvt_Off(const char* port, gpsdevh** fd)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Pvt_Get(gpsdevh** fd, GPS_PPvt_Data* pvt)
+int32_t GPS_Command_Pvt_Get(gpsdevh** fd, GPS_PPvt_Data* pvt)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   if (gps_pvt_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -651,9 +651,9 @@ int32 GPS_Command_Pvt_Get(gpsdevh** fd, GPS_PPvt_Data* pvt)
 ** @return [int32] number of lap entries
 ************************************************************************/
 
-int32 GPS_Command_Get_Lap(const char* port, GPS_PLap** lap, pcb_fn cb)
+int32_t GPS_Command_Get_Lap(const char* port, GPS_PLap** lap, pcb_fn cb)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   if (gps_lap_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -688,18 +688,18 @@ int32 GPS_Command_Get_Lap(const char* port, GPS_PLap** lap, pcb_fn cb)
 **
 ** @return [int32] number of course entries
 ************************************************************************/
-int32  GPS_Command_Get_Course
+int32_t GPS_Command_Get_Course
 (const char* port,
  GPS_PCourse** crs,
  GPS_PCourse_Lap** clp,
  GPS_PTrack** trk,
  GPS_PCourse_Point** cpt,
- int32* n_clp,
- int32* n_trk,
- int32* n_cpt,
+ int32_t* n_clp,
+ int32_t* n_trk,
+ int32_t* n_cpt,
  pcb_fn cb)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   if (gps_course_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -768,24 +768,24 @@ int32  GPS_Command_Get_Course
 **
 ** @return [int32] Success
 ************************************************************************/
-int32  GPS_Command_Send_Course
+int32_t GPS_Command_Send_Course
 (const char* port,
  GPS_PCourse* crs,
  GPS_PCourse_Lap* clp,
  GPS_PTrack* trk,
  GPS_PCourse_Point* cpt,
- int32 n_crs,
- int32 n_clp,
- int32 n_trk,
- int32 n_cpt)
+ int32_t n_crs,
+ int32_t n_clp,
+ int32_t n_trk,
+ int32_t n_cpt)
 {
   gpsdevh* fd;
   GPS_OCourse_Limits limits;
-  int32 ret;
-  int32 ret_crs=0;
-  int32 ret_clp=0;
-  int32 ret_trk=0;
-  int32 ret_cpt=0;
+  int32_t ret;
+  int32_t ret_crs = 0;
+  int32_t ret_clp = 0;
+  int32_t ret_trk = 0;
+  int32_t ret_cpt = 0;
 
   if (gps_course_transfer == -1 || gps_course_limits_transfer == -1) {
     return GPS_UNSUPPORTED;
@@ -886,9 +886,9 @@ int32  GPS_Command_Send_Course
 **
 ** @return [uint32] course index
 ************************************************************************/
-static uint32 Unique_Course_Index(GPS_PCourse* crs, int n_crs)
+static uint32_t Unique_Course_Index(GPS_PCourse* crs, int n_crs)
 {
-  uint32 idx;
+       uint32_t idx;
   int i;
 
   for (idx=0; ; idx++) {
@@ -913,9 +913,9 @@ static uint32 Unique_Course_Index(GPS_PCourse* crs, int n_crs)
 **
 ** @return [uint32] track index
 ************************************************************************/
-static uint32 Unique_Track_Index(GPS_PCourse* crs, int n_crs)
+static uint32_t Unique_Track_Index(GPS_PCourse* crs, int n_crs)
 {
-  uint32 idx;
+       uint32_t idx;
   int i;
 
   for (idx=0; ; idx++) {
@@ -1082,7 +1082,7 @@ restart_laps:
   /* Remove unreferenced tracks */
 restart_tracks:
   for (i=0; i<*n_ctk; i++) {
-    uint32 trk_idx;
+         uint32_t trk_idx;
 
     if (!ctk[i]->ishdr) {
       continue;
@@ -1150,8 +1150,8 @@ restart_course_points:
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32 n_trk,
-                                       GPS_PWay* wpt, int32 n_wpt, int eraset)
+int32_t GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32_t n_trk,
+                                         GPS_PWay* wpt, int32_t n_wpt, int eraset)
 {
   GPS_PCourse* crs = nullptr;
   GPS_PCourse_Lap* clp = nullptr;
@@ -1159,7 +1159,7 @@ int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32
   GPS_PCourse_Point* cpt = nullptr;
   int n_crs, n_clp=0, n_ctk=0, n_cpt=0;
   int i, j, trk_end, new_crs, first_new_ctk;
-  int32 ret;
+  int32_t ret;
 
   /* Read existing courses from device */
   if (eraset) {
@@ -1248,7 +1248,7 @@ int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32
   cpt = (GPS_SCourse_Point**) xrealloc(cpt, (n_cpt+n_wpt) * sizeof(GPS_PCourse_Point));
   for (i=0; i<n_wpt; i++) {
     double dist, min_dist = DBL_MAX;
-    uint32 min_dist_idx = 0, trk_idx = 0, min_dist_trk_idx = 0;
+    uint32_t min_dist_idx = 0, trk_idx = 0, min_dist_trk_idx = 0;
 
     /* Find closest track point */
     for (j=first_new_ctk; j<n_ctk; j++) {
@@ -1314,22 +1314,23 @@ int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32
 }
 
 /*Stubs for unimplemented stuff*/
-int32  GPS_Command_Get_Workout(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
+int32_t GPS_Command_Get_Workout(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
 {
   return 0;
 }
 
-int32  GPS_Command_Get_Fitness_User_Profile(const char* /* port */, void**  /* lap */, int (* /* cb */)(int, GPS_SWay**))
+int32_t GPS_Command_Get_Fitness_User_Profile(const char* /* port */, void** /* lap */,
+                                             int (* /* cb */)(int, GPS_SWay**))
 {
   return 0;
 }
 
-int32  GPS_Command_Get_Workout_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
+int32_t GPS_Command_Get_Workout_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
 {
   return 0;
 }
 
-int32  GPS_Command_Get_Course_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
+int32_t GPS_Command_Get_Course_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
 {
   return 0;
 }
index c8cc2580602cfc2f31a13745b461c1e13e3613ae..88f7f6c6903c860da070caf8e77a6618e2cd57fc 100644 (file)
@@ -5,43 +5,43 @@
 #include "jeeps/gps.h"
 #include <ctime>
 
-  int32  GPS_Command_Off(const char* port);
+int32_t GPS_Command_Off(const char* port);
 
   time_t GPS_Command_Get_Time(const char* port);
-  int32  GPS_Command_Send_Time(const char* port, time_t Time);
+int32_t GPS_Command_Send_Time(const char* port, time_t Time);
 
-  int32  GPS_Command_Get_Position(const char* port, double* lat, double* lon);
-  int32  GPS_Command_Send_Position(const char* port, double lat, double lon);
+int32_t GPS_Command_Get_Position(const char* port, double* lat, double* lon);
+int32_t GPS_Command_Send_Position(const char* port, double lat, double lon);
 
-  int32  GPS_Command_Pvt_On(const char* port, gpsdevh** fd);
-  int32  GPS_Command_Pvt_Off(const char* port, gpsdevh** fd);
-  int32  GPS_Command_Pvt_Get(gpsdevh** fd, GPS_PPvt_Data* pvt);
+int32_t GPS_Command_Pvt_On(const char* port, gpsdevh** fd);
+int32_t GPS_Command_Pvt_Off(const char* port, gpsdevh** fd);
+int32_t GPS_Command_Pvt_Get(gpsdevh** fd, GPS_PPvt_Data* pvt);
 
-  int32  GPS_Command_Get_Almanac(const char* port, GPS_PAlmanac** alm);
-  int32  GPS_Command_Send_Almanac(const char* port, GPS_PAlmanac* alm, int32 n);
+int32_t GPS_Command_Get_Almanac(const char* port, GPS_PAlmanac** alm);
+int32_t GPS_Command_Send_Almanac(const char* port, GPS_PAlmanac* alm, int32_t n);
 
-  int32  GPS_Command_Get_Track(const char* port, GPS_PTrack** trk, int (*cb)(int, GPS_SWay**));
-  int32  GPS_Command_Send_Track(const char* port, GPS_PTrack* trk, int32 n, int eraset);
+int32_t GPS_Command_Get_Track(const char* port, GPS_PTrack** trk, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Send_Track(const char* port, GPS_PTrack* trk, int32_t n, int eraset);
 
-  int32  GPS_Command_Get_Waypoint(const char* port, GPS_PWay** way,int (*cb)(int, GPS_SWay**));
-  int32  GPS_Command_Send_Waypoint(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_SWay**));
+int32_t GPS_Command_Get_Waypoint(const char* port, GPS_PWay** way, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Send_Waypoint(const char* port, GPS_PWay* way, int32_t n, int (*cb)(GPS_SWay**));
 
-  int32  GPS_Command_Get_Proximity(const char* port, GPS_PWay** way);
-  int32  GPS_Command_Send_Proximity(const char* port, GPS_PWay* way, int32 n);
+int32_t GPS_Command_Get_Proximity(const char* port, GPS_PWay** way);
+int32_t GPS_Command_Send_Proximity(const char* port, GPS_PWay* way, int32_t n);
 
-  int32  GPS_Command_Get_Route(const char* port, GPS_PWay** way);
-  int32  GPS_Command_Send_Route(const char* port, GPS_PWay* way, int32 n);
+int32_t GPS_Command_Get_Route(const char* port, GPS_PWay** way);
+int32_t GPS_Command_Send_Route(const char* port, GPS_PWay* way, int32_t n);
 
-  int32  GPS_Command_Get_Lap(const char* port, GPS_PLap** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Lap(const char* port, GPS_PLap** lap, int (*cb)(int, GPS_SWay**));
 
-  int32  GPS_Command_Send_Course(const char* port, GPS_PCourse* crs, GPS_PCourse_Lap* clp,
-                                 GPS_PTrack* trk, GPS_PCourse_Point* cpt,
-                                 int32 n_crs, int32 n_clp, int32 n_trk, int32 n_cpt);
-  int32  GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32 n_trk,
-                                          GPS_PWay* wpt, int32 n_wpt, int eraset);
+int32_t GPS_Command_Send_Course(const char* port, GPS_PCourse* crs, GPS_PCourse_Lap* clp,
+                                GPS_PTrack* trk, GPS_PCourse_Point* cpt,
+                                int32_t n_crs, int32_t n_clp, int32_t n_trk, int32_t n_cpt);
+int32_t GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32_t n_trk,
+                                         GPS_PWay* wpt, int32_t n_wpt, int eraset);
 
-  int32  GPS_Command_Get_Workout(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
-  int32  GPS_Command_Get_Fitness_User_Profile(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
-  int32  GPS_Command_Get_Workout_Limits(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
-  int32  GPS_Command_Get_Course_Limits(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Workout(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Fitness_User_Profile(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Workout_Limits(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Course_Limits(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
 #endif // JEEPS_GPSCOM_H_INCLUDED_
index 1294b3da8987a4b540216837e1ff823157aa7587..654da137af722c2861df6b2b239b8adaec4aad4a 100644 (file)
@@ -27,7 +27,7 @@ extern gps_device_ops gps_serial_ops;
 extern gps_device_ops gps_usb_ops;
 static gps_device_ops* ops = nullptr;
 
-int32  GPS_Device_On(const char* port, gpsdevh** fd)
+int32_t GPS_Device_On(const char* port, gpsdevh** fd)
 {
   gps_is_usb = (0 == case_ignore_strncmp(port, "usb:", 4));
 
@@ -40,32 +40,32 @@ int32  GPS_Device_On(const char* port, gpsdevh** fd)
   return (ops->Device_On)(port, fd);
 }
 
-int32  GPS_Device_Off(gpsdevh* fd)
+int32_t GPS_Device_Off(gpsdevh* fd)
 {
   return (ops->Device_Off)(fd);
 }
 
-int32  GPS_Device_Wait(gpsdevh* fd)
+int32_t GPS_Device_Wait(gpsdevh* fd)
 {
   return (ops->Device_Wait)(fd);
 }
 
-int32  GPS_Device_Chars_Ready(gpsdevh* fd)
+int32_t GPS_Device_Chars_Ready(gpsdevh* fd)
 {
   return (ops->Device_Chars_Ready)(fd);
 }
 
-int32  GPS_Device_Flush(gpsdevh* fd)
+int32_t GPS_Device_Flush(gpsdevh* fd)
 {
   return (ops->Device_Flush)(fd);
 }
 
-int32  GPS_Write_Packet(gpsdevh* fd, const GPS_Packet& packet)
+int32_t GPS_Write_Packet(gpsdevh* fd, const GPS_Packet& packet)
 {
   return (ops->Write_Packet)(fd, packet);
 }
 
-int32 GPS_Packet_Read(gpsdevh* fd, GPS_Packet* packet)
+int32_t GPS_Packet_Read(gpsdevh* fd, GPS_Packet* packet)
 {
   return (ops->Read_Packet)(fd, packet);
 }
@@ -80,7 +80,7 @@ bool GPS_Get_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec)
   return (ops->Get_Ack)(fd, tra, rec);
 }
 
-void GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32 n)
+void GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32_t n)
 {
   packet->type = type;
   if (n > 0) {
index 5abf56b0a7f9b656901473b6776129c4b399a143..444e869a6f4e256086069257172f55bb89a074ae 100644 (file)
 #define usecDELAY 180000       /* Microseconds before GPS sends A001 */
 
 
-  int32  GPS_Device_Chars_Ready(gpsdevh* fd);
-  int32  GPS_Device_On(const char* port, gpsdevh** fd);
-  int32  GPS_Device_Off(gpsdevh* fd);
-  int32  GPS_Device_Wait(gpsdevh* fd);
-  int32  GPS_Device_Flush(gpsdevh* fd);
-  int32  GPS_Device_Read(int32 ignored, void* ibuf, int size);
-  int32  GPS_Device_Write(int32 ignored, const void* obuf, int size);
+int32_t GPS_Device_Chars_Ready(gpsdevh* fd);
+int32_t GPS_Device_On(const char* port, gpsdevh** fd);
+int32_t GPS_Device_Off(gpsdevh* fd);
+int32_t GPS_Device_Wait(gpsdevh* fd);
+int32_t GPS_Device_Flush(gpsdevh* fd);
+int32_t GPS_Device_Read(int32_t ignored, void* ibuf, int size);
+int32_t GPS_Device_Write(int32_t ignored, const void* obuf, int size);
   void   GPS_Device_Error(char* hdr, ...);
-  int32  GPS_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
+int32_t GPS_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
   bool   GPS_Send_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
-  int32  GPS_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
+int32_t GPS_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
   bool   GPS_Get_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
 
-  using gps_device_op = int32 (*)(gpsdevh*);
-  using gps_device_op5 = int32 (*)(const char*, gpsdevh** fd);
+  using gps_device_op = int32_t (*)(gpsdevh*);
+  using gps_device_op5 = int32_t (*)(const char*, gpsdevh** fd);
   using gps_device_op10 = bool (*)(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
-  using gps_device_op12 = int32 (*)(gpsdevh* fd, const GPS_Packet& packet);
-  using gps_device_op13 = int32 (*)(gpsdevh* fd, GPS_Packet* packet);
+  using gps_device_op12 = int32_t (*)(gpsdevh* fd, const GPS_Packet& packet);
+  using gps_device_op13 = int32_t (*)(gpsdevh* fd, GPS_Packet* packet);
 
   typedef struct {
     gps_device_op5 Device_On;
index 15e37c19eaeca0e5e7597bd2a458d8b6f0c855bb..3ab6d8a7293df9a33c8c516b55b2613ce698117b 100644 (file)
@@ -32,17 +32,17 @@ static bool success_stub()
   return true;
 }
 
-static int32 gdu_on(const char* port, gpsdevh** fd)
+static int32_t gdu_on(const char* port, gpsdevh** fd)
 {
   return gusb_init(port, fd);
 }
 
-static int32 gdu_off(gpsdevh* dh)
+static int32_t gdu_off(gpsdevh* dh)
 {
   return gusb_close(dh);
 }
 
-static int32  gdu_read(gpsdevh* fd, GPS_Packet* packet)
+static int32_t gdu_read(gpsdevh* fd, GPS_Packet* packet)
 {
   /* Default is to eat bulk request packets. */
   return GPS_Packet_Read_usb(fd, packet, 1);
index 3cf101690ac879e2c10f9c666361fb2a64dfe376..9471eb3f429b4eaefe33c8858b942257eeb0d988 100644 (file)
@@ -9,10 +9,10 @@
   void   GPS_Fmt_Print_Time(time_t Time, FILE* outf);
   void   GPS_Fmt_Print_Position(double lat, double lon, FILE* outf);
   void   GPS_Fmt_Print_Pvt(GPS_PPvt_Data pvt, FILE* outf);
-  void   GPS_Fmt_Print_Almanac(GPS_PAlmanac* alm, int32 n, FILE* outf);
-  void   GPS_Fmt_Print_Track(GPS_PTrack* trk, int32 n, FILE* outf);
-  int32  GPS_Fmt_Print_Waypoint(GPS_PWay* way, int32 n, FILE* outf);
-  int32  GPS_Fmt_Print_Proximity(GPS_PWay* way, int32 n, FILE* outf);
-  int32  GPS_Fmt_Print_Route(GPS_PWay* way, int32 n, FILE* outf);
+  void   GPS_Fmt_Print_Almanac(GPS_PAlmanac* alm, int32_t n, FILE* outf);
+  void   GPS_Fmt_Print_Track(GPS_PTrack* trk, int32_t n, FILE* outf);
+int32_t GPS_Fmt_Print_Waypoint(GPS_PWay* way, int32_t n, FILE* outf);
+int32_t GPS_Fmt_Print_Proximity(GPS_PWay* way, int32_t n, FILE* outf);
+int32_t GPS_Fmt_Print_Route(GPS_PWay* way, int32_t n, FILE* outf);
 
 #endif // JEEPS_GPSFMT_H_INCLUDED_
index b489c5bf6057e553775c86622e0897ab818219af..56a24581a958e728ef170c6761a1b32f0e7c9e55 100644 (file)
 #include <cstring>
 
 
-static int32 GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32* zone,
-    char* zc, double* Mc, double* E0,
-    double* N0, double* F0);
-static int32 GPS_Math_UTM_Param_To_Mc(int32 zone, char zc, double* Mc,
-                                      double* E0, double* N0, double* F0);
+static int32_t GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32_t* zone,
+                                            char* zc, double* Mc, double* E0,
+                                            double* N0, double* F0);
+static int32_t GPS_Math_UTM_Param_To_Mc(int32_t zone, char zc, double* Mc,
+                                        double* E0, double* N0, double* F0);
 
 
 
@@ -79,9 +79,9 @@ double GPS_Math_Rad_To_Deg(double v)
 ** @return [void]
 ************************************************************************/
 
-void GPS_Math_Deg_To_DegMin(double v, int32* d, double* m)
+void GPS_Math_Deg_To_DegMin(double v, int32_t* d, double* m)
 {
-  int32 sign;
+       int32_t sign;
 
   if (v<0.) {
     v *= -1.;
@@ -90,7 +90,7 @@ void GPS_Math_Deg_To_DegMin(double v, int32* d, double* m)
     sign = 0;
   }
 
-  *d = (int32)v;
+  *d = (int32_t)v;
   *m = (v-(double)*d) * 60.0;
   if (*m>59.999) {
     ++*d;
@@ -117,7 +117,7 @@ void GPS_Math_Deg_To_DegMin(double v, int32* d, double* m)
 ** @return [void]
 ************************************************************************/
 
-void GPS_Math_DegMin_To_Deg(int32 d, double m, double* deg)
+void GPS_Math_DegMin_To_Deg(int32_t d, double m, double* deg)
 {
 
   *deg = ((double)abs(d)) + m / 60.0;
@@ -142,9 +142,9 @@ void GPS_Math_DegMin_To_Deg(int32 d, double m, double* deg)
 ** @return [void]
 ************************************************************************/
 
-void GPS_Math_Deg_To_DegMinSec(double v, int32* d, int32* m, double* s)
+void GPS_Math_Deg_To_DegMinSec(double v, int32_t* d, int32_t* m, double* s)
 {
-  int32 sign;
+       int32_t sign;
   double t;
 
   if (v<0.) {
@@ -154,10 +154,10 @@ void GPS_Math_Deg_To_DegMinSec(double v, int32* d, int32* m, double* s)
     sign = 0;
   }
 
-  *d = (int32)v;
+  *d = (int32_t)v;
   t  = (v -(double)*d) * 60.0;
   *m = (v-(double)*d) * 60.0;
-  *s = (t - (int32)t) * 60.0;
+  *s = (t - (int32_t)t) * 60.0;
 
   if (*s>59.999) {
     ++t;
@@ -170,7 +170,7 @@ void GPS_Math_Deg_To_DegMinSec(double v, int32* d, int32* m, double* s)
     t = 0;
   }
 
-  *m = (int32)t;
+  *m = (int32_t)t;
 
   if (sign) {
     *d = -*d;
@@ -193,7 +193,7 @@ void GPS_Math_Deg_To_DegMinSec(double v, int32* d, int32* m, double* s)
 ** @return [void]
 ************************************************************************/
 
-void GPS_Math_DegMinSec_To_Deg(int32 d, int32 m, double s, double* deg)
+void GPS_Math_DegMinSec_To_Deg(int32_t d, int32_t m, double s, double* deg)
 {
 
   *deg = ((double)abs(d)) + ((double)m + s / 60.0) / 60.0;
@@ -247,7 +247,7 @@ double GPS_Math_Feet_To_Metres(double v)
 ** @return [int32] semicircles
 ************************************************************************/
 
-int32 GPS_Math_Deg_To_Semi(double v)
+int32_t GPS_Math_Deg_To_Semi(double v)
 {
   return round(((double)(1U<<31) / 180.0) * v);
 }
@@ -263,7 +263,7 @@ int32 GPS_Math_Deg_To_Semi(double v)
 ** @return [double] degrees
 ************************************************************************/
 
-double GPS_Math_Semi_To_Deg(int32 v)
+double GPS_Math_Semi_To_Deg(int32_t v)
 {
   return (((double)v / (double)(1U<<31)) * 180.0);
 }
@@ -367,8 +367,8 @@ void GPS_Math_XYZ_To_LatLonH(double* phi, double* lambda, double* H,
   double phix;
   double nphi;
   double rho;
-  int32    t1=0;
-  int32    t2=0;
+  int32_t t1 = 0;
+  int32_t t2 = 0;
 
   if (x<0.0 && y>=0.0) {
     t1=1;
@@ -689,8 +689,8 @@ void GPS_Math_Airy1830LatLonToNGEN(double phi, double lambda, double* E,
 ** @return [void]
 ************************************************************************/
 
-int32 GPS_Math_WGS84_To_Swiss_EN(double lat, double lon, double* E,
-                                 double* N)
+int32_t GPS_Math_WGS84_To_Swiss_EN(double lat, double lon, double* E,
+                                   double* N)
 {
   const double phi0 = 46.95240556;
   const double lambda0 = 7.43958333;
@@ -1086,8 +1086,8 @@ void GPS_Math_Cassini_EN_To_LatLon(double E, double N, double* phi,
 ** @return [void]
 ************************************************************************/
 
-int32 GPS_Math_WGS84_To_ICS_EN(double lat, double lon, double* E,
-                               double* N)
+int32_t GPS_Math_WGS84_To_ICS_EN(double lat, double lon, double* E,
+                                 double* N)
 {
   double const phi0    = 31.73409694444; // 31 44 2.749
   double const lambda0 = 35.21208055556; // 35 12 43.49
@@ -1095,11 +1095,11 @@ int32 GPS_Math_WGS84_To_ICS_EN(double lat, double lon, double* E,
   double const N0      = 1126867.909;
   double phi, lambda, alt, a, b;
 
-  int32 datum   = GPS_Lookup_Datum_Index("Palestine 1923");
+  int32_t datum = GPS_Lookup_Datum_Index("Palestine 1923");
   if (datum < 0) {
     fatal("Unable to find Palestine 1923 in internal tables");
   }
-  int32 ellipse = GPS_Datum[datum].ellipse;
+  int32_t ellipse = GPS_Datum[datum].ellipse;
 
   a = GPS_Ellipse[ellipse].a;
   b = a - (a / GPS_Ellipse[ellipse].invf);
@@ -1131,11 +1131,11 @@ void GPS_Math_ICS_EN_To_WGS84(double E, double N, double* lat, double* lon)
   double const E0      = 170251.555;
   double const N0      = 1126867.909;
   double phi, lambda, alt, a, b;
-  int32 datum   = GPS_Lookup_Datum_Index("Palestine 1923");
+  int32_t datum = GPS_Lookup_Datum_Index("Palestine 1923");
   if (datum < 0) {
     fatal("Unable to find Palestine 1923 in internal tables");
   }
-  int32 ellipse = GPS_Datum[datum].ellipse;
+  int32_t ellipse = GPS_Datum[datum].ellipse;
 
   a = GPS_Ellipse[ellipse].a;
   b = a - (a / GPS_Ellipse[ellipse].invf);
@@ -1350,24 +1350,24 @@ void GPS_Math_INGENToAiry1830MLatLon(double E, double N, double* phi,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_EN_To_UKOSNG_Map(double E, double N, double* mE,
-                                double* mN, char* map)
+int32_t GPS_Math_EN_To_UKOSNG_Map(double E, double N, double* mE,
+                                  double* mN, char* map)
 {
-  int32  t;
-  int32  idx;
+       int32_t t;
+       int32_t idx;
 
   if (E>=700000. || E<0.0 || N<0.0 ||
       N>=1300000.0) {
     return 0;
   }
 
-  idx = ((int32)N/100000)*7 + (int32)E/100000;
+  idx = ((int32_t)N/100000)*7 + (int32_t)E/100000;
   (void) strcpy(map,UKNG[idx]);
 
-  t = ((int32)E / 100000) * 100000;
+  t = ((int32_t)E / 100000) * 100000;
   *mE = E - (double)t;
 
-  t = ((int32)N / 100000) * 100000;
+  t = ((int32_t)N / 100000) * 100000;
   *mN = N - (double)t;
 
   return 1;
@@ -1389,11 +1389,11 @@ int32 GPS_Math_EN_To_UKOSNG_Map(double E, double N, double* mE,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_UKOSNG_Map_To_EN(const char* map, double mapE, double mapN,
-                                double* E, double* N)
+int32_t GPS_Math_UKOSNG_Map_To_EN(const char* map, double mapE, double mapN,
+                                  double* E, double* N)
 {
-  int32  t;
-  int32  idx;
+       int32_t t;
+       int32_t idx;
 
   if (mapE>=100000.0 || mapE<0.0 || mapN<0.0 ||
       mapN>100000.0) {
@@ -1525,7 +1525,7 @@ void GPS_Math_Molodensky(double Sphi, double Slam, double SH, double Sa,
 ************************************************************************/
 void GPS_Math_Known_Datum_To_WGS84_M(double Sphi, double Slam, double SH,
                                      double* Dphi, double* Dlam, double* DH,
-                                     int32 n)
+                                     int32_t n)
 {
   double Sa;
   double Sif;
@@ -1534,7 +1534,7 @@ void GPS_Math_Known_Datum_To_WGS84_M(double Sphi, double Slam, double SH,
   double x;
   double y;
   double z;
-  int32    idx;
+  int32_t idx;
 
   Da  = 6378137.0;
   Dif = 298.257223563;
@@ -1569,7 +1569,7 @@ void GPS_Math_Known_Datum_To_WGS84_M(double Sphi, double Slam, double SH,
 ************************************************************************/
 void GPS_Math_WGS84_To_Known_Datum_M(double Sphi, double Slam, double SH,
                                      double* Dphi, double* Dlam, double* DH,
-                                     int32 n)
+                                     int32_t n)
 {
   double Sa;
   double Sif;
@@ -1578,7 +1578,7 @@ void GPS_Math_WGS84_To_Known_Datum_M(double Sphi, double Slam, double SH,
   double x;
   double y;
   double z;
-  int32    idx;
+  int32_t idx;
 
   Sa  = 6378137.0;
   Sif = 298.257223563;
@@ -1613,7 +1613,7 @@ void GPS_Math_WGS84_To_Known_Datum_M(double Sphi, double Slam, double SH,
 ************************************************************************/
 void GPS_Math_Known_Datum_To_WGS84_C(double Sphi, double Slam, double SH,
                                      double* Dphi, double* Dlam, double* DH,
-                                     int32 n)
+                                     int32_t n)
 {
   double Sa;
   double Sif;
@@ -1624,7 +1624,7 @@ void GPS_Math_Known_Datum_To_WGS84_C(double Sphi, double Slam, double SH,
   double x;
   double y;
   double z;
-  int32    idx;
+  int32_t idx;
   double sx;
   double sy;
   double sz;
@@ -1670,7 +1670,7 @@ void GPS_Math_Known_Datum_To_WGS84_C(double Sphi, double Slam, double SH,
 ************************************************************************/
 void GPS_Math_WGS84_To_Known_Datum_C(double Sphi, double Slam, double SH,
                                      double* Dphi, double* Dlam, double* DH,
-                                     int32 n)
+                                     int32_t n)
 {
   double Sa;
   double Sif;
@@ -1679,7 +1679,7 @@ void GPS_Math_WGS84_To_Known_Datum_C(double Sphi, double Slam, double SH,
   double x;
   double y;
   double z;
-  int32    idx;
+  int32_t idx;
   double Sb;
   double Db;
   double dx;
@@ -1728,7 +1728,7 @@ void GPS_Math_WGS84_To_Known_Datum_C(double Sphi, double Slam, double SH,
 ************************************************************************/
 void GPS_Math_Known_Datum_To_Known_Datum_M(double Sphi, double Slam, double SH,
     double* Dphi, double* Dlam,
-    double* DH, int32 n1, int32 n2)
+    double* DH, int32_t n1, int32_t n2)
 {
   double Sa;
   double Sif;
@@ -1744,8 +1744,8 @@ void GPS_Math_Known_Datum_To_Known_Datum_M(double Sphi, double Slam, double SH,
   double y;
   double z;
 
-  int32    idx1;
-  int32    idx2;
+  int32_t idx1;
+  int32_t idx2;
 
 
   idx1 = GPS_Datum[n1].ellipse;
@@ -1790,7 +1790,7 @@ void GPS_Math_Known_Datum_To_Known_Datum_M(double Sphi, double Slam, double SH,
 ************************************************************************/
 void GPS_Math_Known_Datum_To_Known_Datum_C(double Sphi, double Slam, double SH,
     double* Dphi, double* Dlam,
-    double* DH, int32 n1, int32 n2)
+    double* DH, int32_t n1, int32_t n2)
 {
   double Sa;
   double Sif;
@@ -1803,8 +1803,8 @@ void GPS_Math_Known_Datum_To_Known_Datum_C(double Sphi, double Slam, double SH,
   double y2;
   double z2;
 
-  int32    idx1;
-  int32    idx2;
+  int32_t idx1;
+  int32_t idx2;
 
   double Sb;
   double Db;
@@ -1855,8 +1855,8 @@ void GPS_Math_Known_Datum_To_Known_Datum_C(double Sphi, double Slam, double SH,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_WGS84_To_UKOSMap_M(double lat, double lon, double* mE,
-                                  double* mN, char* map)
+int32_t GPS_Math_WGS84_To_UKOSMap_M(double lat, double lon, double* mE,
+                                    double* mN, char* map)
 {
   double alat;
   double alon;
@@ -1891,8 +1891,8 @@ int32 GPS_Math_WGS84_To_UKOSMap_M(double lat, double lon, double* mE,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_UKOSMap_To_WGS84_M(const char* map, double mE, double mN,
-                                  double* lat, double* lon)
+int32_t GPS_Math_UKOSMap_To_WGS84_M(const char* map, double mE, double mN,
+                                    double* lat, double* lon)
 {
   double E;
   double N;
@@ -1926,8 +1926,8 @@ int32 GPS_Math_UKOSMap_To_WGS84_M(const char* map, double mE, double mN,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_WGS84_To_UKOSMap_C(double lat, double lon, double* mE,
-                                  double* mN, char* map)
+int32_t GPS_Math_WGS84_To_UKOSMap_C(double lat, double lon, double* mE,
+                                    double* mN, char* map)
 {
   double alat;
   double alon;
@@ -1962,8 +1962,8 @@ int32 GPS_Math_WGS84_To_UKOSMap_C(double lat, double lon, double* mE,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_UKOSMap_To_WGS84_C(const char* map, double mE, double mN,
-                                  double* lat, double* lon)
+int32_t GPS_Math_UKOSMap_To_WGS84_C(const char* map, double mE, double mN,
+                                    double* lat, double* lon)
 {
   double E;
   double N;
@@ -1998,12 +1998,12 @@ int32 GPS_Math_UKOSMap_To_WGS84_C(const char* map, double mE, double mN,
 **
 ** @return [int32] success
 ************************************************************************/
-static int32 GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32* zone,
-    char* zc, double* Mc, double* E0,
-    double* N0, double* F0)
+static int32_t GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32_t* zone,
+                                            char* zc, double* Mc, double* E0,
+                                            double* N0, double* F0)
 {
-  int32 ilon;
-  int32 ilat;
+       int32_t ilon;
+       int32_t ilat;
   bool psign;
   bool lsign;
 
@@ -2019,8 +2019,8 @@ static int32 GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32* zone,
     psign=true;
   }
 
-  ilon = abs((int32)lon);
-  ilat = abs((int32)lat);
+  ilon = abs((int32_t)lon);
+  ilat = abs((int32_t)lat);
 
   if (!lsign) {
     *zone = 31 + (ilon / 6);
@@ -2098,8 +2098,8 @@ static int32 GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32* zone,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_NAD83_To_UTM_EN(double lat, double lon, double* E,
-                               double* N, int32* zone, char* zc)
+int32_t GPS_Math_NAD83_To_UTM_EN(double lat, double lon, double* E,
+                                 double* N, int32_t* zone, char* zc)
 {
   double phi0;
   double lambda0;
@@ -2139,8 +2139,8 @@ int32 GPS_Math_NAD83_To_UTM_EN(double lat, double lon, double* E,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_WGS84_To_UTM_EN(double lat, double lon, double* E,
-                               double* N, int32* zone, char* zc)
+int32_t GPS_Math_WGS84_To_UTM_EN(double lat, double lon, double* E,
+                                 double* N, int32_t* zone, char* zc)
 {
   double phi;
   double lambda;
@@ -2170,8 +2170,8 @@ int32 GPS_Math_WGS84_To_UTM_EN(double lat, double lon, double* E,
 **
 ** @return [int32] success
 ************************************************************************/
-static int32 GPS_Math_UTM_Param_To_Mc(int32 zone, char zc, double* Mc,
-                                      double* E0, double* N0, double* F0)
+static int32_t GPS_Math_UTM_Param_To_Mc(int32_t zone, char zc, double* Mc,
+                                        double* E0, double* N0, double* F0)
 {
 
   if (zone>60 || zone<0 || zc<'C' || zc>'X' || zc=='I' || zc=='O') {
@@ -2210,8 +2210,8 @@ static int32 GPS_Math_UTM_Param_To_Mc(int32 zone, char zc, double* Mc,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_UTM_EN_To_NAD83(double* lat, double* lon, double E,
-                               double N, int32 zone, char zc)
+int32_t GPS_Math_UTM_EN_To_NAD83(double* lat, double* lon, double E,
+                                 double N, int32_t zone, char zc)
 {
   return GPS_Math_UTM_EN_To_Known_Datum(lat, lon, E, N, zone, zc, 77);
 }
@@ -2231,8 +2231,8 @@ int32 GPS_Math_UTM_EN_To_NAD83(double* lat, double* lon, double E,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
-                               double N, int32 zone, char zc)
+int32_t GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
+                                 double N, int32_t zone, char zc)
 {
   double lambda0;
   double N0;
@@ -2262,8 +2262,8 @@ int32 GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
-                                     double* N, int32* zone, char* zc, const int n)
+int32_t GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
+                                       double* N, int32_t* zone, char* zc, const int n)
 {
   double phi0;
   double lambda0;
@@ -2272,7 +2272,7 @@ int32 GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
   double F0;
   double a;
   double b;
-  int32  idx;
+  int32_t idx;
 
   if (!GPS_Math_LatLon_To_UTM_Param(lat,lon,zone,zc,&lambda0,&E0,
                                     &N0,&F0)) {
@@ -2304,8 +2304,8 @@ int32 GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_Math_UTM_EN_To_Known_Datum(double* lat, double* lon, double E,
-                                     double N, int32 zone, char zc, const int n)
+int32_t GPS_Math_UTM_EN_To_Known_Datum(double* lat, double* lon, double E,
+                                       double N, int32_t zone, char zc, const int n)
 {
   double lambda0;
   double N0;
@@ -2547,7 +2547,7 @@ void GPS_Math_UTM_EN_to_LatLon(int ReferenceEllipsoid,
 
 /********************************************************************/
 
-int32 GPS_Lookup_Datum_Index(const char* n)
+int32_t GPS_Lookup_Datum_Index(const char* n)
 {
   GPS_PDatum dp;
   GPS_PDatum_Alias al;
@@ -2567,7 +2567,7 @@ int32 GPS_Lookup_Datum_Index(const char* n)
   return -1;
 }
 
-int32 GPS_Lookup_Datum_Index(const QString& n)
+int32_t GPS_Lookup_Datum_Index(const QString& n)
 {
   return GPS_Lookup_Datum_Index(CSTR(n));
 }
index fa35c1ce0b5dd5ec8d4b0bd96405de836429f79d..39dd394b1c3fc6467700f0caaefcf570346fc9b8 100644 (file)
   double GPS_Math_Metres_To_Feet(double v);
   double GPS_Math_Feet_To_Metres(double v);
 
-  int32  GPS_Math_Deg_To_Semi(double v);
-  double GPS_Math_Semi_To_Deg(int32 v);
+int32_t GPS_Math_Deg_To_Semi(double v);
+  double GPS_Math_Semi_To_Deg(int32_t v);
 
   time_t GPS_Math_Utime_To_Gtime(time_t v);
   time_t GPS_Math_Gtime_To_Utime(time_t v);
 
-  void   GPS_Math_Deg_To_DegMin(double v, int32* d, double* m);
-  void   GPS_Math_DegMin_To_Deg(int32 d, double m, double* deg);
-  void   GPS_Math_Deg_To_DegMinSec(double v, int32* d, int32* m, double* s);
-  void   GPS_Math_DegMinSec_To_Deg(int32 d, int32 m, double s, double* deg);
+  void   GPS_Math_Deg_To_DegMin(double v, int32_t* d, double* m);
+  void   GPS_Math_DegMin_To_Deg(int32_t d, double m, double* deg);
+  void   GPS_Math_Deg_To_DegMinSec(double v, int32_t* d, int32_t* m, double* s);
+  void   GPS_Math_DegMinSec_To_Deg(int32_t d, int32_t m, double s, double* deg);
 
 
   void GPS_Math_Airy1830LatLonToNGEN(double phi, double lambda, double* E,
                                      double* N);
   void GPS_Math_Airy1830M_LatLonToINGEN(double phi, double lambda, double* E,
                                         double* N);
-  int32  GPS_Math_EN_To_UKOSNG_Map(double E, double N, double* mE,
-                                   double* mN, char* map);
-  int32  GPS_Math_UKOSNG_Map_To_EN(const char* map, double mapE, double mapN,
-                                   double* E, double* N);
+int32_t GPS_Math_EN_To_UKOSNG_Map(double E, double N, double* mE,
+                                  double* mN, char* map);
+int32_t GPS_Math_UKOSNG_Map_To_EN(const char* map, double mapE, double mapN,
+                                  double* E, double* N);
 
   void GPS_Math_LatLonH_To_XYZ(double phi, double lambda, double H,
                                double* x, double* y, double* z,
                            double dy, double dz);
   void GPS_Math_Known_Datum_To_WGS84_M(double Sphi, double Slam, double SH,
                                        double* Dphi, double* Dlam, double* DH,
-                                       int32 n);
+                                       int32_t n);
   void GPS_Math_WGS84_To_Known_Datum_M(double Sphi, double Slam, double SH,
                                        double* Dphi, double* Dlam, double* DH,
-                                       int32 n);
+                                       int32_t n);
   void GPS_Math_Known_Datum_To_WGS84_C(double Sphi, double Slam, double SH,
                                        double* Dphi, double* Dlam, double* DH,
-                                       int32 n);
+                                       int32_t n);
   void GPS_Math_WGS84_To_Known_Datum_C(double Sphi, double Slam, double SH,
                                        double* Dphi, double* Dlam, double* DH,
-                                       int32 n);
+                                       int32_t n);
 
   void GPS_Math_Known_Datum_To_Known_Datum_M(double Sphi, double Slam, double SH,
       double* Dphi, double* Dlam,
-      double* DH, int32 n1, int32 n2);
+      double* DH, int32_t n1, int32_t n2);
   void GPS_Math_Known_Datum_To_Known_Datum_C(double Sphi, double Slam, double SH,
       double* Dphi, double* Dlam,
-      double* DH, int32 n1, int32 n2);
+      double* DH, int32_t n1, int32_t n2);
 
-  int32 GPS_Math_WGS84_To_UKOSMap_M(double lat, double lon, double* mE,
+int32_t GPS_Math_WGS84_To_UKOSMap_M(double lat, double lon, double* mE,
                                     double* mN, char* map);
-  int32 GPS_Math_UKOSMap_To_WGS84_M(const char* map, double mE, double mN,
+int32_t GPS_Math_UKOSMap_To_WGS84_M(const char* map, double mE, double mN,
                                     double* lat, double* lon);
-  int32 GPS_Math_WGS84_To_UKOSMap_C(double lat, double lon, double* mE,
+int32_t GPS_Math_WGS84_To_UKOSMap_C(double lat, double lon, double* mE,
                                     double* mN, char* map);
-  int32 GPS_Math_UKOSMap_To_WGS84_C(const char* map, double mE, double mN,
+int32_t GPS_Math_UKOSMap_To_WGS84_C(const char* map, double mE, double mN,
                                     double* lat, double* lon);
 
 
-  int32 GPS_Math_NAD83_To_UTM_EN(double lat, double lon, double* E,
-                                 double* N, int32* zone, char* zc);
-  int32 GPS_Math_WGS84_To_UTM_EN(double lat, double lon, double* E,
-                                 double* N, int32* zone, char* zc);
+int32_t GPS_Math_NAD83_To_UTM_EN(double lat, double lon, double* E,
+                                 double* N, int32_t* zone, char* zc);
+int32_t GPS_Math_WGS84_To_UTM_EN(double lat, double lon, double* E,
+                                 double* N, int32_t* zone, char* zc);
 
-  int32 GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
-                                 double N, int32 zone, char zc);
-  int32 GPS_Math_UTM_EN_To_NAD83(double* lat, double* lon, double E,
-                                 double N, int32 zone, char zc);
+int32_t GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
+                                 double N, int32_t zone, char zc);
+int32_t GPS_Math_UTM_EN_To_NAD83(double* lat, double* lon, double E,
+                                 double N, int32_t zone, char zc);
 
-  int32 GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
-                                       double* N, int32* zone, char* zc, int n);
-  int32 GPS_Math_UTM_EN_To_Known_Datum(double* lat, double* lon, double E,
-                                       double N, int32 zone, char zc, int n);
+int32_t GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
+                                       double* N, int32_t* zone, char* zc, int n);
+int32_t GPS_Math_UTM_EN_To_Known_Datum(double* lat, double* lon, double E,
+                                       double N, int32_t zone, char zc, int n);
 
   void GPS_Math_Swiss_LatLon_To_EN(double phi, double lambda, double* E,
                                    double* N,double phi0,double lambda0,
                                      double* lambda, double phi0, double M0,
                                      double E0, double N0, double a, double b);
 
-  int32 GPS_Math_WGS84_To_ICS_EN(double lat, double lon, double* E,
+int32_t GPS_Math_WGS84_To_ICS_EN(double lat, double lon, double* E,
                                  double* N);
   void GPS_Math_ICS_EN_To_WGS84(double E, double N, double* lat, double* lon);
 
-  int32 GPS_Math_WGS84_To_Swiss_EN(double phi, double lambda, double* E, double* N);
+int32_t GPS_Math_WGS84_To_Swiss_EN(double phi, double lambda, double* E, double* N);
   void GPS_Math_Swiss_EN_To_WGS84(double E, double N, double* lat, double* lon);
 
   void GPS_Math_UTM_EN_to_LatLon(int ReferenceEllipsoid,
                                  double* Lat, double* Lon,
                                  double lambda0, double E0, double N0);
 
-  int32 GPS_Lookup_Datum_Index(const char* n);
-  int32 GPS_Lookup_Datum_Index(const QString& n);
+int32_t GPS_Lookup_Datum_Index(const char* n);
+int32_t GPS_Lookup_Datum_Index(const QString& n);
   const char* GPS_Math_Get_Datum_Name(int datum_index);
 
 #endif // JEEPS_GPSMATH_H_INCLUDED_
index 5489345aeee7a4749b13467d19941b8f09c6f547..4757d9e79295ac07db0e27fb3847e41b3ef3cc88 100644 (file)
@@ -167,7 +167,7 @@ void GPS_Track_Del(GPS_PTrack* thys)
 GPS_PWay GPS_Way_New()
 {
   GPS_PWay ret;
-  int32 i;
+  int32_t i;
 
   if (!(ret=(GPS_PWay)xcalloc(sizeof(GPS_OWay),1))) {
     perror("malloc");
index 3646a3e67e18206f4d4184af8409661bb3c42539..c161ee5d3a410fb2523e6992a9eefab725823576 100644 (file)
@@ -15,9 +15,5 @@
 
 typedef unsigned char UC;
 typedef uint16_t      US;
-typedef uint16_t      uint16;
-typedef int16_t       int16;
-typedef uint32_t      uint32;
-typedef int32_t       int32;
 
 #endif // JEEPS_GPSPORT_H_INCLUDED_
index f61bcf88d47e63ac412ddc2f7ca06a11d7381d02..fbf2b596c0efcf2ade261b713c4eaf5fab563db2 100644 (file)
@@ -29,9 +29,9 @@
 #define GPS_TAGUNK  20
 
 /* Storage for any unknown tags */
-static int32 gps_tag_unknown[GPS_TAGUNK];
-static int32 gps_tag_data_unknown[GPS_TAGUNK];
-static int32 gps_n_tag_unknown = 0;
+static int32_t gps_tag_unknown[GPS_TAGUNK];
+static int32_t gps_tag_data_unknown[GPS_TAGUNK];
+static int32_t gps_n_tag_unknown = 0;
 
 
 COMMANDDATA COMMAND_ID[2]= {
@@ -343,9 +343,9 @@ US GPS_Protocol_Version_Change(US id, US version)
 ** @return [int32] Success
 ************************************************************************/
 
-int32 GPS_Protocol_Table_Set(US id)
+int32_t GPS_Protocol_Table_Set(US id)
 {
-  int32 i;
+       int32_t i;
   US  v;
 
   i=0;
@@ -411,7 +411,7 @@ void GPS_Protocol_Error(US tag, US data)
 
 void GPS_Unknown_Protocol_Print()
 {
-  int32 i;
+       int32_t i;
 
   (void) fprintf(stdout,"\nUnknown protocols: ");
   if (!gps_n_tag_unknown) {
index 5a2a3cc6c1f302506e41d7ceafe820fef4caa739..12d45b55df1d19dfcf0e01bb887da3c4e7b8df20 100644 (file)
@@ -62,7 +62,7 @@
 #define pA010 10
 #define pA011 11
 
-  COMMON int32 gps_device_command;
+  COMMON int32_t gps_device_command;
 
 
   struct COMMANDDATA {
    * Waypoint Transfer Protocol
    */
 #define pA100 100
-  COMMON int32 gps_waypt_transfer;
+  COMMON int32_t gps_waypt_transfer;
 
   /*
    * Waypoint category transfer protocol
    */
 #define pA101 101
-  COMMON int32 gps_category_transfer;
+  COMMON int32_t gps_category_transfer;
 
   /*
    * Route Transfer Protocol
    */
 #define pA200 200
 #define pA201 201
-  COMMON int32 gps_route_transfer;
+  COMMON int32_t gps_route_transfer;
 
   /*
    * Track Log Transfer Protocol
 #define pA301 301
 #define pA302 302
 #define pA304 304
-  COMMON int32 gps_trk_transfer;
+  COMMON int32_t gps_trk_transfer;
 
   /*
    *  Proximity Waypoint Transfer Protocol
    */
 #define pA400 400
-  COMMON int32 gps_prx_waypt_transfer;
+  COMMON int32_t gps_prx_waypt_transfer;
 
   /*
    *  Almanac Transfer Protocol
    */
 #define pA500 500
-  COMMON int32 gps_almanac_transfer;
+  COMMON int32_t gps_almanac_transfer;
 
 
   /*
    *  Date Time Transfer
    */
 #define pA600 600
-  COMMON int32 gps_date_time_transfer;
+  COMMON int32_t gps_date_time_transfer;
 
   /*
    *  FlightBook Transfer Protocol
    *  Position
    */
 #define pA700 700
-  COMMON int32 gps_position_transfer;
+  COMMON int32_t gps_position_transfer;
 
 
   /*
    *  Pvt
    */
 #define pA800 800
-  COMMON int32 gps_pvt_transfer;
+  COMMON int32_t gps_pvt_transfer;
 
   /*
    * Lap Data Transfer
    */
 #define pA906 906
-  COMMON int32 gps_lap_transfer;
+  COMMON int32_t gps_lap_transfer;
 
   /*
    * Various fitness related
    */
 #define pA1000 1000
-  COMMON int32 gps_run_transfer;
+  COMMON int32_t gps_run_transfer;
 #define pA1002 1002
-  COMMON int32 gps_workout_transfer;
+  COMMON int32_t gps_workout_transfer;
 #define pA1004 1004
-  COMMON int32 gps_user_profile_transfer;
+  COMMON int32_t gps_user_profile_transfer;
 #define pA1005 1005
-  COMMON int32 gps_workout_limits_transfer;
+  COMMON int32_t gps_workout_limits_transfer;
 #define pA1006 1006
-  COMMON int32 gps_course_transfer;
+  COMMON int32_t gps_course_transfer;
 #define pA1007 1007
-  COMMON int32 gps_course_lap_transfer;
+  COMMON int32_t gps_course_lap_transfer;
 #define pA1008 1008
-  COMMON int32 gps_course_point_transfer;
+  COMMON int32_t gps_course_point_transfer;
 #define pA1009 1009
-  COMMON int32 gps_course_limits_transfer;
+  COMMON int32_t gps_course_limits_transfer;
 #define pA1012 1012
-  COMMON int32 gps_course_trk_transfer;
+  COMMON int32_t gps_course_trk_transfer;
 
   /*
    * Waypoint D Type
 #define pD154 154
 #define pD155 155
 
-  COMMON int32 gps_rte_type;
-  COMMON int32 gps_waypt_type;
+  COMMON int32_t gps_rte_type;
+  COMMON int32_t gps_waypt_type;
 
   /*
    * Waypoint category types
    */
 #define pD120 120
-  COMMON int32 gps_category_type;
+  COMMON int32_t gps_category_type;
 
   /*
    * Rte Header Type
 #define pD200 200
 #define pD201 201
 #define pD202 202
-  COMMON int32 gps_rte_hdr_type;
+  COMMON int32_t gps_rte_hdr_type;
 
 
   /*
    * Rte Link Type
    */
 #define pD210 210
-  COMMON int32 gps_rte_link_type;
+  COMMON int32_t gps_rte_link_type;
 
 
   /*
 #define pD302 302
 #define pD303 303
 #define pD304 304
-  COMMON int32 gps_trk_type;
-  COMMON int32 gps_run_crs_trk_type;
+  COMMON int32_t gps_trk_type;
+  COMMON int32_t gps_run_crs_trk_type;
 
 
   /*
 #define pD310 310
 #define pD311 311
 #define pD312 312
-  COMMON int32 gps_trk_hdr_type;
-  COMMON int32 gps_run_crs_trk_hdr_type;
+  COMMON int32_t gps_trk_hdr_type;
+  COMMON int32_t gps_run_crs_trk_hdr_type;
 
 
 
 #define pD403 403
 #define pD450 450
 
-  COMMON int32 gps_prx_waypt_type;
+  COMMON int32_t gps_prx_waypt_type;
 
 
   /*
 #define pD550 550
 #define pD551 551
 
-  COMMON int32 gps_almanac_type;
+  COMMON int32_t gps_almanac_type;
 
 
   /*
    */
 #define pD600 600
 
-  COMMON int32 gps_date_time_type;
+  COMMON int32_t gps_date_time_type;
 
 
 
    */
 #define pD700 700
 
-  COMMON int32 gps_position_type;
+  COMMON int32_t gps_position_type;
 
 
 
    */
 #define pD800 800
 
-  COMMON int32 gps_pvt_type;
+  COMMON int32_t gps_pvt_type;
 
   /*
    * Lap Data Type
 #define pD1011 1011
 #define pD1015 1015
 
-  COMMON int32 gps_lap_type;
+  COMMON int32_t gps_lap_type;
 
   /*
    * Various fitness related
 #define pD1000 1000
 #define pD1009 1009
 #define pD1010 1010
-  COMMON int32 gps_run_type;
+  COMMON int32_t gps_run_type;
 #define pD1002 1002
 #define pD1008 1008
-  COMMON int32 gps_workout_type;
+  COMMON int32_t gps_workout_type;
 #define pD1003 1003
-  COMMON int32 gps_workout_occurrence_type;
+  COMMON int32_t gps_workout_occurrence_type;
 #define pD1004 1004
-  COMMON int32 gps_user_profile_type;
+  COMMON int32_t gps_user_profile_type;
 #define pD1005 1005
-  COMMON int32 gps_workout_limits_type;
+  COMMON int32_t gps_workout_limits_type;
 #define pD1006 1006
-  COMMON int32 gps_course_type;
+  COMMON int32_t gps_course_type;
 #define pD1007 1007
-  COMMON int32 gps_course_lap_type;
+  COMMON int32_t gps_course_lap_type;
 #define pD1012 1012
-  COMMON int32 gps_course_point_type;
+  COMMON int32_t gps_course_point_type;
 #define pD1013 1013
-  COMMON int32 gps_course_limits_type;
+  COMMON int32_t gps_course_limits_type;
 
   /*
    * Link protocol type
 #define pL001 1
 #define pL002 2
 
-  COMMON int32 gps_link_type;
+  COMMON int32_t gps_link_type;
 
 
 
   struct GPS_MODEL_PROTOCOL {
     US    id;
-    int32 link;
-    int32 command;
-    int32 wayptt;
-    int32 wayptd;
-    int32 rtea;
-    int32 rted0;
-    int32 rted1;
-    int32 trka;
-    int32 trkd;
-    int32 prxa;
-    int32 prxd;
-    int32 alma;
-    int32 almd;
+    int32_t link;
+    int32_t command;
+    int32_t wayptt;
+    int32_t wayptd;
+    int32_t rtea;
+    int32_t rted0;
+    int32_t rted1;
+    int32_t trka;
+    int32_t trkd;
+    int32_t prxa;
+    int32_t prxd;
+    int32_t alma;
+    int32_t almd;
   };
 
   US     GPS_Protocol_Version_Change(US id, US version);
-  COMMON int32  GPS_Protocol_Table_Set(US id);
+  COMMON int32_t GPS_Protocol_Table_Set(US id);
   void   GPS_Protocol_Error(US tag, US data);
   void   GPS_Unknown_Protocol_Print();
 
index db9aef4bd9b8cce0b07c2cb1aeb350ac7326d0a6..048e58ce4c55f0b1111a500bc882dc7eaa48e8f5 100644 (file)
@@ -69,10 +69,10 @@ time_t GPS_Time_Now()
 ** @return [int32] number of bytes read
 **********************************************************************/
 
-int32 GPS_Serial_Packet_Read(gpsdevh* fd, GPS_Packet* packet)
+int32_t GPS_Serial_Packet_Read(gpsdevh* fd, GPS_Packet* packet)
 {
   time_t start;
-  int32 len = 0;
+  int32_t len = 0;
   UC u;
   UC* p;
   UC chk = 0, chk_read;
index 6bee1e7abf54e67ec510623c7ed96e9de2ea76e8..c5937234cf48a7dedc18bc8ac44ab453849e101f 100644 (file)
@@ -5,7 +5,7 @@
 #include "jeeps/gps.h"
 
   time_t GPS_Time_Now();
-  int32  GPS_Serial_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
+int32_t GPS_Serial_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
   bool GPS_Serial_Get_Ack(gpsdevh *fd, GPS_Packet *tra, GPS_Packet *rec);
 
 #endif // JEEPS_GPSREAD_H_INCLUDED_
index 82a28adbceaaf041133949147344e842c1afc624..79b2db57f5d0775f0a0c60b41b57bd94763655aa 100644 (file)
@@ -25,8 +25,8 @@
 #include "jeeps/gps.h"
 
 
-static int32 GPS_A600_Rqst(gpsdevh* fd, time_t Time);
-static int32 GPS_A700_Rqst(gpsdevh* fd, double lat, double lon);
+static int32_t GPS_A600_Rqst(gpsdevh* fd, time_t Time);
+static int32_t GPS_A700_Rqst(gpsdevh* fd, double lat, double lon);
 
 
 
@@ -40,7 +40,7 @@ static int32 GPS_A700_Rqst(gpsdevh* fd, double lat, double lon);
 ** @return [int32] true if OK
 ************************************************************************/
 
-int32 GPS_Rqst_Send_Time(gpsdevh* fd, time_t Time)
+int32_t GPS_Rqst_Send_Time(gpsdevh* fd, time_t Time)
 {
   time_t ret=0;
 
@@ -67,7 +67,7 @@ int32 GPS_Rqst_Send_Time(gpsdevh* fd, time_t Time)
 **
 ** @return [int32] success
 ************************************************************************/
-static int32 GPS_A600_Rqst(gpsdevh* fd, time_t Time)
+static int32_t GPS_A600_Rqst(gpsdevh* fd, time_t Time)
 {
   GPS_Packet tra;
   GPS_Packet rec;
@@ -104,9 +104,9 @@ static int32 GPS_A600_Rqst(gpsdevh* fd, time_t Time)
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Rqst_Send_Position(gpsdevh* fd, double lat, double lon)
+int32_t GPS_Rqst_Send_Position(gpsdevh* fd, double lat, double lon)
 {
-  int32 ret=0;
+       int32_t ret = 0;
 
   switch (gps_position_transfer) {
   case pA700:
@@ -132,7 +132,7 @@ int32 GPS_Rqst_Send_Position(gpsdevh* fd, double lat, double lon)
 **
 ** @return [int32] success
 ************************************************************************/
-static int32 GPS_A700_Rqst(gpsdevh* fd, double lat, double lon)
+static int32_t GPS_A700_Rqst(gpsdevh* fd, double lat, double lon)
 {
   GPS_Packet tra;
   GPS_Packet rec;
index c97e013548ac1339d4fc2b14a0f62174497f6460..601a9ea6530eecf7c5c7c33ff6627f0ee2174d29 100644 (file)
@@ -4,8 +4,8 @@
 
 #include "jeeps/gps.h"
 
-  int32 GPS_Rqst_Send_Time(gpsdevh* fd, time_t Time);
-  int32 GPS_Rqst_Send_Position(gpsdevh* fd, double lat, double lon);
+int32_t GPS_Rqst_Send_Time(gpsdevh* fd, time_t Time);
+int32_t GPS_Rqst_Send_Position(gpsdevh* fd, double lat, double lon);
 
 
 #endif // JEEPS_GPSRQST_H_INCLUDED_
index 07ff72e3d709d8efefebfdc1093e494bcef7062b..55eaa5752c60432930c1049b8eef487320123ad7 100644 (file)
@@ -65,7 +65,7 @@ Build_Serial_Packet(const GPS_Packet& in, GPS_Serial_Packet* out)
 
   chk -= in.n;
 
-  for (uint32 i = 0; i < in.n; ++i) {
+  for (uint32_t i = 0; i < in.n; ++i) {
     if (*p == DLE) {
       ++bytes;
       *q++ = DLE;
@@ -116,9 +116,9 @@ DiagS(void* buf, size_t sz)
 ** @return [int32] number of bytes in the packet
 ************************************************************************/
 
-int32 GPS_Serial_Write_Packet(gpsdevh* fd, const GPS_Packet& packet)
+int32_t GPS_Serial_Write_Packet(gpsdevh* fd, const GPS_Packet& packet)
 {
-  int32 ret;
+       int32_t ret;
   const char* m1, *m2;
   GPS_Serial_Packet ser_pkt;
   UC ser_pkt_data[MAX_GPS_PACKET_SIZE * sizeof(UC)];
index 3f3b12e8d35d47b76b7df9b83901bc6d1220c6b6..a4954a9e445f91be1d64273fcb40e93c5ffff912 100644 (file)
@@ -6,10 +6,10 @@
 
 #define GPS_ARB_LEN 1024
 
-  int32  GPS_Serial_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
+int32_t GPS_Serial_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
   bool  GPS_Serial_Send_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
 
-  void   GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32 n);
+  void   GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32_t n);
 
 
 #endif // JEEPS_GPSSEND_H_INCLUDED_
index 2a3cb4b2eaaaed8b681e812ea9b700d0b8c4c34a..164054bc3225fb7ac8e1abc0bc44f20c6f09073a 100644 (file)
@@ -91,7 +91,7 @@ void GPS_Serial_Error(const char* fmt, ...)
   va_end(ap);
 }
 
-int32 GPS_Serial_On(const char* port, gpsdevh** dh)
+int32_t GPS_Serial_On(const char* port, gpsdevh** dh)
 {
   DCB tio;
   COMMTIMEOUTS timeout;
@@ -161,7 +161,7 @@ int32 GPS_Serial_On(const char* port, gpsdevh** dh)
   return 1;
 }
 
-int32 GPS_Serial_Off(gpsdevh* dh)
+int32_t GPS_Serial_Off(gpsdevh* dh)
 {
   win_serial_data* wsd = (win_serial_data*)dh;
   CloseHandle(wsd->comport);
@@ -170,7 +170,7 @@ int32 GPS_Serial_Off(gpsdevh* dh)
   return 1;
 }
 
-int32 GPS_Serial_Chars_Ready(gpsdevh* dh)
+int32_t GPS_Serial_Chars_Ready(gpsdevh* dh)
 {
   COMSTAT lpStat;
   DWORD lpErrors;
@@ -180,7 +180,7 @@ int32 GPS_Serial_Chars_Ready(gpsdevh* dh)
   return (lpStat.cbInQue > 0);
 }
 
-int32 GPS_Serial_Wait(gpsdevh* fd)
+int32_t GPS_Serial_Wait(gpsdevh* fd)
 {
   /* Wait a short time before testing if data is ready.
    * The GPS II, in particular, has a noticable time responding
@@ -193,12 +193,12 @@ int32 GPS_Serial_Wait(gpsdevh* fd)
   return GPS_Serial_Chars_Ready(fd);
 }
 
-int32 GPS_Serial_Flush(gpsdevh* /* fd */)
+int32_t GPS_Serial_Flush(gpsdevh* /* fd */)
 {
   return 1;
 }
 
-int32 GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
+int32_t GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
 {
   win_serial_data* wsd = (win_serial_data*)dh;
   DWORD len;
@@ -220,7 +220,7 @@ int32 GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
   return len;
 }
 
-int32 GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
+int32_t GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
 {
   DWORD cnt  = 0;
   win_serial_data* wsd = (win_serial_data*)dh;
@@ -231,7 +231,7 @@ int32 GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
 
 // Based on information by Kolesár András from
 // http://www.manualslib.com/manual/413938/Garmin-Gps-18x.html?page=32
-int32 GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br)
+int32_t GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br)
 {
   static UC data[4];
   GPS_Packet tra;
@@ -326,13 +326,13 @@ typedef struct {
 **
 ** Open a serial port 8bits 1 stop bit 9600 baud
 **
-** @param [w] fd [int32 *] file descriptor
+** @param [w] fd [int32_t *] file descriptor
 ** @param [r] port [const char *] port e.g. ttyS1
 **
-** @return [int32] false upon error
+** @return [int32_t] false upon error
 ************************************************************************/
 
-int32 GPS_Serial_Open(gpsdevh* dh, const char* port)
+int32_t GPS_Serial_Open(gpsdevh* dh, const char* port)
 {
   struct termios tty;
   if (global_opts.debug_level >= 2) fprintf(stderr, "GPS Serial Open at %d\n", gps_baud_rate);
@@ -394,7 +394,7 @@ void GPS_Serial_Error(const char* fmt, ...)
   va_end(ap);
 }
 
-int32 GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
+int32_t GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
 {
   auto* psd = (posix_serial_data*)dh;
 #if GARMULATOR
@@ -426,7 +426,7 @@ int32 GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
 #endif
 }
 
-int32 GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
+int32_t GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
 {
   auto* psd = (posix_serial_data*)dh;
   return write(psd->fd, obuf, size);
@@ -437,11 +437,11 @@ int32 GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
 **
 ** Flush the serial lines
 **
-** @param [w] fd [int32] file descriptor
+** @param [w] fd [int32_t] file descriptor
 **
-** @return [int32] false upon error
+** @return [int32_t] false upon error
 ************************************************************************/
-int32 GPS_Serial_Flush(gpsdevh* fd)
+int32_t GPS_Serial_Flush(gpsdevh* fd)
 {
   auto* psd = (posix_serial_data*)fd;
 
@@ -460,13 +460,13 @@ int32 GPS_Serial_Flush(gpsdevh* fd)
 **
 ** Close serial port
 **
-** @param [r] fd [int32 ] file descriptor
+** @param [r] fd [int32_t ] file descriptor
 ** @param [r] port [const char *] port e.g. ttyS1
 **
-** @return [int32] false upon error
+** @return [int32_t] false upon error
 ************************************************************************/
 
-int32 GPS_Serial_Close(gpsdevh* fd)
+int32_t GPS_Serial_Close(gpsdevh* fd)
 {
   auto* psd = (posix_serial_data*)fd;
 
@@ -490,17 +490,17 @@ int32 GPS_Serial_Close(gpsdevh* fd)
 **
 ** Query port to see if characters are waiting to be read
 **
-** @param [r] fd [int32 ] file descriptor
+** @param [r] fd [int32_t ] file descriptor
 **
-** @return [int32] true if chars waiting
+** @return [int32_t] true if chars waiting
 ************************************************************************/
 
-int32 GPS_Serial_Chars_Ready(gpsdevh* dh)
+int32_t GPS_Serial_Chars_Ready(gpsdevh* dh)
 {
   fd_set rec;
   struct timeval t;
   auto* psd = (posix_serial_data*)dh;
-  int32 fd = psd->fd;
+  int32_t fd = psd->fd;
 
 #if GARMULATOR
   static foo;
@@ -533,12 +533,12 @@ int32 GPS_Serial_Chars_Ready(gpsdevh* dh)
 ** appears to be around 40-50 milliseconds. Doubling the value is to
 ** allow some leeway.
 **
-** @param [r] fd [int32 ] file descriptor
+** @param [r] fd [int32_t ] file descriptor
 **
-** @return [int32] true if serial chars waiting
+** @return [int32_t] true if serial chars waiting
 ************************************************************************/
 
-int32 GPS_Serial_Wait(gpsdevh* dh)
+int32_t GPS_Serial_Wait(gpsdevh* dh)
 {
   fd_set rec;
   struct timeval t;
@@ -565,12 +565,12 @@ int32 GPS_Serial_Wait(gpsdevh* dh)
 ** Set up port
 **
 ** @param [r] port [const char *] port
-** @param [w] fd [int32 *] file descriptor
+** @param [w] fd [int32_t *] file descriptor
 **
-** @return [int32] success
+** @return [int32_t] success
 ************************************************************************/
 
-int32 GPS_Serial_On(const char* port, gpsdevh** dh)
+int32_t GPS_Serial_On(const char* port, gpsdevh** dh)
 {
   auto* psd = (posix_serial_data*) xcalloc(sizeof(posix_serial_data), 1);
   *dh = (gpsdevh*) psd;
@@ -591,12 +591,12 @@ int32 GPS_Serial_On(const char* port, gpsdevh** dh)
 ** Done with port
 **
 ** @param [r] port [const char *] port
-** @param [r] fd [int32 ] file descriptor
+** @param [r] fd [int32_t ] file descriptor
 **
-** @return [int32] success
+** @return [int32_t] success
 ************************************************************************/
 
-int32 GPS_Serial_Off(gpsdevh* dh)
+int32_t GPS_Serial_Off(gpsdevh* dh)
 {
 
   if (!GPS_Serial_Close(dh)) {
@@ -609,7 +609,7 @@ int32 GPS_Serial_Off(gpsdevh* dh)
 
 // Based on information by Kolesár András from
 // http://www.manualslib.com/manual/413938/Garmin-Gps-18x.html?page=32
-int32 GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br)
+int32_t GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br)
 {
 
   struct termios tty;
index c960234d373dc8c3be0d675bd9aff740bf3ef301..aa871b3a74964b67537c09cd3adf4dfa42577828 100644 (file)
@@ -7,21 +7,21 @@
 #define usecDELAY 180000       /* Microseconds before GPS sends A001 */
 #define DEFAULT_BAUD 9600
 
-  int32  GPS_Serial_Chars_Ready(gpsdevh* fd);
+int32_t GPS_Serial_Chars_Ready(gpsdevh* fd);
 // int32  GPS_Serial_Close(int32 fd, const char *port);
 // int32  GPS_Serial_Open(int32 *fd, const char *port);
 // int32  GPS_Serial_Open_NMEA(int32 *fd, const char *port);
 // int32  GPS_Serial_Restoretty(const char *port);
 // int32  GPS_Serial_Savetty(const char *port);
-  int32  GPS_Serial_On(const char* port, gpsdevh** fd);
-  int32  GPS_Serial_Off(gpsdevh* fd);
-  int32  GPS_Serial_Wait(gpsdevh* fd);
-  int32  GPS_Serial_Flush(gpsdevh* fd);
+int32_t GPS_Serial_On(const char* port, gpsdevh** fd);
+int32_t GPS_Serial_Off(gpsdevh* fd);
+int32_t GPS_Serial_Wait(gpsdevh* fd);
+int32_t GPS_Serial_Flush(gpsdevh* fd);
 // int32  GPS_Serial_On_NMEA(const char *port, gpsdevh **fd);
-  int32  GPS_Serial_Read(gpsdevh* fd, void* ibuf, int size);
-  int32  GPS_Serial_Write(gpsdevh* fd, const void* obuf, int size);
+int32_t GPS_Serial_Read(gpsdevh* fd, void* ibuf, int size);
+int32_t GPS_Serial_Write(gpsdevh* fd, const void* obuf, int size);
 
 
-int32  GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br);
+int32_t GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br);
 
 #endif // JEEPS_GPSSERIAL_H_INCLUDED_
index 2e557d1c57d5c1cbfde1250127e749ae4c82e6a6..2689f5a4266529360fde791538a6312e17c374dd 100644 (file)
@@ -24,8 +24,8 @@
 #ifndef JEEPS_GPSUSBINT_H_INCLUDED_
 #define JEEPS_GPSUSBINT_H_INCLUDED_
 
-int32 GPS_Packet_Read_usb(gpsdevh* fd, GPS_Packet* packet, int eatbulk);
-int32 GPS_Write_Packet_usb(gpsdevh* fd, const GPS_Packet& packet);
+int32_t GPS_Packet_Read_usb(gpsdevh* fd, GPS_Packet* packet, int eatbulk);
+int32_t GPS_Write_Packet_usb(gpsdevh* fd, const GPS_Packet& packet);
 
 #endif // JEEPS_GPSUSBINT_H_INCLUDED_
 
index 59d83c352d6ef239fb9de3dc3135d1783dc668d2..4a524be123828b4520180c945c93c180f4e830d1 100644 (file)
  * Negative on error.
  * 1 if read success - even if empty packet.
  */
-int32 GPS_Packet_Read_usb(gpsdevh* /*unused*/, GPS_Packet* packet, int eat_bulk)
+int32_t GPS_Packet_Read_usb(gpsdevh* /*unused*/, GPS_Packet* packet, int eat_bulk)
 {
-  int32  n;
-  int32 payload_size;
+       int32_t n;
+       int32_t payload_size;
 
   garmin_usb_packet pkt;
 
index 90da93d05f8738a7820241f26473158dc02d78ce..9aba7b534fa723245c53d76286667efacf6487f3 100644 (file)
@@ -25,7 +25,7 @@
 #include <cerrno>
 #include <cstdio>
 
-int32
+int32_t
 GPS_Write_Packet_usb(gpsdevh* /*unused*/, const GPS_Packet& packet)
 {
   garmin_usb_packet gp;
index 68c5f926d0b3552a824710355baa8cbdd56c6d5c..2628badb7f557a9fc85d0210052fe73ce1307f0b 100644 (file)
 #include <cstdlib>
 #include <fcntl.h>
 
-static int32 gps_endian_called=0;
-static int32 GPS_Little=0;
+static int32_t gps_endian_called = 0;
+static int32_t GPS_Little = 0;
 
-int32 gps_warning = 0;
-int32 gps_error   = 0;
-int32 gps_user    = 0;
-int32 gps_show_bytes = 0;
-int32 gps_errno = 0;
+int32_t gps_warning = 0;
+int32_t gps_error = 0;
+int32_t gps_user = 0;
+int32_t gps_show_bytes = 0;
+int32_t gps_errno = 0;
 
 /* @func GPS_Util_Little ***********************************************
 **
@@ -42,11 +42,11 @@ int32 gps_errno = 0;
 ** @return [int32] true if little-endian
 ************************************************************************/
 
-int32 GPS_Util_Little()
+int32_t GPS_Util_Little()
 {
   static union lb {
-    char chars[sizeof(int32)];
-    int32 i;
+    char chars[sizeof(int32_t)];
+    int32_t i;
   }
   data;
 
@@ -130,7 +130,7 @@ double GPS_Util_Get_Double(const UC* s)
 {
   double ret;
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = (UC*)&ret;
 
@@ -140,7 +140,7 @@ double GPS_Util_Get_Double(const UC* s)
       *p++ = s[i];
     }
   else
-    for (i=0; i<(int32)sizeof(double); ++i) {
+    for (i=0; i<(int32_t)sizeof(double); ++i) {
       *p++ = s[i];
     }
 
@@ -161,7 +161,7 @@ double GPS_Util_Get_Double(const UC* s)
 
 void GPS_Util_Put_Double(UC* s, const double v)
 {
-  int32 i;
+       int32_t i;
 
   const auto* p = reinterpret_cast<const UC*>(&v);
 
@@ -170,7 +170,7 @@ void GPS_Util_Put_Double(UC* s, const double v)
       s[i] = *p++;
     }
   else
-    for (i=0; i<(int32)sizeof(double); ++i) {
+    for (i=0; i<(int32_t)sizeof(double); ++i) {
       s[i] = *p++;
     }
 
@@ -187,21 +187,21 @@ void GPS_Util_Put_Double(UC* s, const double v)
 ** @return [int32] value
 ************************************************************************/
 
-int32 GPS_Util_Get_Int(const UC* s)
+int32_t GPS_Util_Get_Int(const UC* s)
 {
-  int32 ret;
+       int32_t ret;
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = (UC*)&ret;
 
 
   if (!GPS_Little)
-    for (i=sizeof(int32)-1; i>-1; --i) {
+    for (i=sizeof(int32_t)-1; i>-1; --i) {
       *p++ = s[i];
     }
   else
-    for (i=0; i<(int32)sizeof(int32); ++i) {
+    for (i=0; i<(int32_t)sizeof(int32_t); ++i) {
       *p++ = s[i];
     }
 
@@ -220,18 +220,18 @@ int32 GPS_Util_Get_Int(const UC* s)
 ** @return [void]
 ************************************************************************/
 
-void GPS_Util_Put_Int(UC* s, const int32 v)
+void GPS_Util_Put_Int(UC* s, const int32_t v)
 {
-  int32 i;
+       int32_t i;
 
   const auto* p = reinterpret_cast<const UC*>(&v);
 
   if (!GPS_Little)
-    for (i=sizeof(int32)-1; i>-1; --i) {
+    for (i=sizeof(int32_t)-1; i>-1; --i) {
       s[i] = *p++;
     }
   else
-    for (i=0; i<(int32)sizeof(int32); ++i) {
+    for (i=0; i<(int32_t)sizeof(int32_t); ++i) {
       s[i] = *p++;
     }
 
@@ -247,21 +247,21 @@ void GPS_Util_Put_Int(UC* s, const int32 v)
 ** @return [uint32] value
 ************************************************************************/
 
-uint32 GPS_Util_Get_Uint(const UC* s)
+uint32_t GPS_Util_Get_Uint(const UC* s)
 {
-  uint32 ret;
+       uint32_t ret;
   UC*     p;
-  int32  i;
+  int32_t i;
 
   p = (UC*)&ret;
 
 
   if (!GPS_Little)
-    for (i=sizeof(uint32)-1; i>-1; --i) {
+    for (i=sizeof(uint32_t)-1; i>-1; --i) {
       *p++ = s[i];
     }
   else
-    for (i=0; i<(int32)sizeof(uint32); ++i) {
+    for (i=0; i<(int32_t)sizeof(uint32_t); ++i) {
       *p++ = s[i];
     }
 
@@ -280,18 +280,18 @@ uint32 GPS_Util_Get_Uint(const UC* s)
 ** @return [void]
 ************************************************************************/
 
-void GPS_Util_Put_Uint(UC* s, const uint32 v)
+void GPS_Util_Put_Uint(UC* s, const uint32_t v)
 {
-  int32 i;
+       int32_t i;
 
   const auto* p = reinterpret_cast<const UC*>(&v);
 
   if (!GPS_Little)
-    for (i=sizeof(uint32)-1; i>-1; --i) {
+    for (i=sizeof(uint32_t)-1; i>-1; --i) {
       s[i] = *p++;
     }
   else
-    for (i=0; i<(int32)sizeof(uint32); ++i) {
+    for (i=0; i<(int32_t)sizeof(uint32_t); ++i) {
       s[i] = *p++;
     }
 
@@ -311,7 +311,7 @@ float GPS_Util_Get_Float(const UC* s)
 {
   float ret;
   UC* p;
-  int32 i;
+  int32_t i;
 
   p = (UC*)&ret;
 
@@ -321,7 +321,7 @@ float GPS_Util_Get_Float(const UC* s)
       *p++ = s[i];
     }
   else
-    for (i=0; i<(int32)sizeof(float); ++i) {
+    for (i=0; i<(int32_t)sizeof(float); ++i) {
       *p++ = s[i];
     }
 
@@ -342,7 +342,7 @@ float GPS_Util_Get_Float(const UC* s)
 
 void GPS_Util_Put_Float(UC* s, const float v)
 {
-  int32 i;
+       int32_t i;
 
   const auto* p = reinterpret_cast<const UC*>(&v);
 
@@ -351,7 +351,7 @@ void GPS_Util_Put_Float(UC* s, const float v)
       s[i] = *p++;
     }
   else
-    for (i=0; i<(int32)sizeof(float); ++i) {
+    for (i=0; i<(int32_t)sizeof(float); ++i) {
       s[i] = *p++;
     }
 
@@ -637,7 +637,7 @@ void GPS_Enable_User()
 ** @@
 ****************************************************************************/
 
-void GPS_Diagnose(int32 c)
+void GPS_Diagnose(int32_t c)
 {
   if (!gps_show_bytes) {
     return;
index 212742833a846138a9fd631da35a76d43dfbad4a..87f47e23d6d9a8b815153aaf7922dca6582e3920 100644 (file)
@@ -4,20 +4,20 @@
 
 #include "jeeps/gps.h"
 
-  int32  GPS_Util_Little();
+int32_t GPS_Util_Little();
 
   US     GPS_Util_Get_Short(const UC* s);
   void   GPS_Util_Put_Short(UC* s, US v);
-  int32  GPS_Util_Get_Int(const UC* s);
-  void   GPS_Util_Put_Int(UC* s, int32 v);
+int32_t GPS_Util_Get_Int(const UC* s);
+  void   GPS_Util_Put_Int(UC* s, int32_t v);
   double GPS_Util_Get_Double(const UC* s);
   void   GPS_Util_Put_Double(UC* s, double v);
   float  GPS_Util_Get_Float(const UC* s);
   void   GPS_Util_Put_Float(UC* s, float v);
-  void   GPS_Util_Canon(int32 state);
-  int32  GPS_Util_Block(int32 fd, int32 state);
-  void   GPS_Util_Put_Uint(UC* s, uint32 v);
-  uint32 GPS_Util_Get_Uint(const UC* s);
+  void   GPS_Util_Canon(int32_t state);
+int32_t GPS_Util_Block(int32_t fd, int32_t state);
+  void   GPS_Util_Put_Uint(UC* s, uint32_t v);
+uint32_t GPS_Util_Get_Uint(const UC* s);
 
   void   GPS_Warning(const char* s);
   [[gnu::format(printf, 1, 2)]] void   GPS_Error(const char* fmt, ...);
@@ -30,7 +30,7 @@
   [[gnu::format(printf, 1, 2)]] void   GPS_User(const char* fmt, ...);
   void   GPS_Disable_User();
   void   GPS_Enable_User();
-  void   GPS_Diagnose(int32 c);
+  void   GPS_Diagnose(int32_t c);
   [[gnu::format(printf, 1, 2)]] void   GPS_Diag(const char* fmt, ...);
 
   void   GPS_Enable_Diagnose();
diff --git a/xcsv.cc b/xcsv.cc
index 9123cf606ac18d720b1aec940abdbf40b85b5e71..0047814812a0ac7a59d31b2d382cd098adbd37d0 100644 (file)
--- a/xcsv.cc
+++ b/xcsv.cc
@@ -988,7 +988,7 @@ XcsvFormat::xcsv_waypt_pr(const Waypoint* wpt)
 {
   QString buff;
   double latitude, longitude;
-  int32 utmz;
+  int32_t utmz;
   double utme, utmn;
   char utmzc;